<SCRIPT> function Set() { t = 0.0; dt = 0.01; x = 0.0; y = 1.0; a = 100.0; b = 100.0; c = -100.0; d = 100.0; i = 0; j = 0; document.munt.setX(i); document.munt.setY(j); } function baan1() { a = 100.0; c = -100.0; } function baan2() { a = 50.0; c = -50.0; } function run() { t = t + dt; x = Math.sin(2*3.14*t); y = Math.cos(2*3.14*t); i = Math.round(a*x + b); j = Math.round(c*y + d); document.munt.setX(i); document.munt.setY(j); if (t<10.0) {window.setTimeout("run();",5)}; } </SCRIPT> .... <CENTER> <APPLET CODE="Animatie.class" NAME=munt WIDTH=200 HEIGHT=200></APPLET> <FORM> <INPUT TYPE="button" NAME="S" VALUE="Start" onClick="Set(this.form)"> <INPUT TYPE="button" NAME="C1" VALUE="Baan groot" onClick="baan1(this.form)"> <INPUT TYPE="button" NAME="C2" VALUE="Baan klein" onClick="baan2(this.form)"> <INPUT TYPE="button" NAME="R" VALUE="Run" onClick="run(this.form)"> </FORM> </CENTER>
Enschede, 2 maart 2000; update: Febr. 2004