import java.awt.*; import java.awt.event.*; import java.applet.*; public class Autosoit1 extends Applet{ double x=100, y=50, pikkus=30, a=Math.PI/6; public void paint(Graphics g){ double x2=x+Math.cos(a)*pikkus; double y2=y+Math.sin(a)*pikkus; g.drawLine((int)x, (int)y, (int)x2, (int)y2); } public static void main(String[] arg){ Frame f=new Frame("Joonest auto"); f.add(new Autosoit1()); f.setSize(200, 200); f.setVisible(true); } }