import java.applet.Applet; import java.awt.*; public class kolmn1 extends Applet implements Runnable{ int laius=300, korgus=300; int koht=99; Image pilt, sahver; Graphics piltg, sahverg; Thread tr=null; public void init(){ Rectangle r=this.bounds(); //laius=r.x; //korgus=r.y; pilt=createImage(laius, korgus); sahver=createImage(laius, korgus); piltg=pilt.getGraphics(); sahverg=sahver.getGraphics(); kolmnurk(5, laius/2, korgus/2, 0, sahverg, new Color(128, 255, 0)); } public void edasi(){ piltg.drawImage(sahver, 0, 0, null); if(koht<51){ kolmnurk(5, laius/2, korgus/2, (float)(koht*Math.PI/50), piltg, Color.red); } else if(koht<61){ kolmnurk(5, laius/2+(koht-50)*2, korgus/2, (float)Math.PI, piltg, Color.red); } else if(koht<91){ kolmnurk(5, laius/2+(koht-50)*2, korgus/2+(koht-60)*2, (float)Math.PI, piltg, Color.red); } koht++; if(koht>100)koht=0; repaint(); } public void kolmnurk(int n, int x, int y, float nurk, Graphics g, Color c){ int i, j; float ns, nc; ns=(float)Math.sin(nurk); nc=(float)Math.cos(nurk); g.setColor(c); for(i=0; i