import java.applet.Applet; import java.awt.*; import java.lang.*; public class Nelinurk extends Applet{ public void paint(Graphics g){ Dimension suurus=getSize(); double x1=10, y1=suurus.height-10, x2=suurus.width-10, y2=suurus.height-10, x3=suurus.width-10, y3=10, x4=10, y4=10; double ax1, ay1, ax2, ay2, ax3, ay3, ax4, ay4; double vx=1, sx=100; int kordustearv=30; double nihe=0.1, jaak=1-nihe; String asd= "asd"; while ((sx-vx)>5){ g.drawLine((int)x1, (int)y1, (int)x2, (int)y2); g.drawLine((int)x2, (int)y2, (int)x3, (int)y3); g.drawLine((int)x3, (int)y3, (int)x4, (int)y4); g.drawLine((int)x4, (int)y4, (int)x1, (int)y1); asd=asd.valueOf((int)(sx-vx)); g.clearRect(1,1,40,20); g.drawString(asd,10,10); try{Thread.sleep(100);}catch(Exception e){} ax1=x1*jaak+x2*nihe; ay1=y1*jaak+y2*nihe; ax2=x2*jaak+x3*nihe; ay2=y2*jaak+y3*nihe; ax3=x3*jaak+x4*nihe; ay3=y3*jaak+y4*nihe; ax4=x4*jaak+x1*nihe; ay4=y4*jaak+y1*nihe; x1=ax1; y1=ay1; x2=ax2; y2=ay2; x3=ax3; y3=ay3; x4=ax4; y4=ay4; if (x1>x2){sx=x1;} else {sx=x2;} if (x3>x2){sx=x3;} if (x4>x3){sx=x4;} if (x1