import java.applet.*; import java.awt.*; public class Ruum3 extends Applet implements Runnable{ double nurk=0; double nurk2=2*Math.PI/10; double nurgasamm=0.05; double raadius=50; int keskx=100; int kesky=100; public Ruum3(){new Thread(this).start();} void liigu(){ nurk=nurk+nurgasamm; nurk2=nurk2+nurgasamm; } void joonista(Graphics g){ int x=(int)(raadius*Math.cos(nurk)); int z=(int)(raadius*Math.sin(nurk)); int y=0; int x2=(int)(raadius*Math.cos(nurk2)); int z2=(int)(raadius*Math.sin(nurk2)); int y2=0; g.fillOval(ex(x)-5, ey(y)-5, 10, 10); g.fillOval(ex(x2)-5, ey(y2)-5, 10, 10); } int ex(double x){return keskx+(int)x;} int ey(double y){return kesky-(int)y;} public void run(){ while(true){ try{ Graphics g=getGraphics(); liigu(); g.setColor(Color.black); joonista(g); Thread.sleep(100); g.setColor(getBackground()); joonista(g); }catch(Exception e){} } } public static void main(String arg[]){ Frame f=new Frame(); f.add(new Ruum3()); f.setSize(200, 200); f.setVisible(true); } }