One dimensional motion with constant velocity.
Code
<html>
<head>
<title>Animator NCSU Example</title>
<script language="JavaScript">
var ball_1 = 0;
var ball_2 = 0;
function initialize(){
document.myAnimator.setShapeRGB(255,0,0);
ball_1 = document.myAnimator.addObject("circle", "x=-22+(12*t),y=-2,r=10");
eq = "-20";
document.myAnimator.setShapeRGB(0,0,255);
ball_2 = document.myAnimator.addObject("circle", "x="+eq+", y=2,r=10");
document.myAnimator.setTimeOneShot(5,"End");
document.myAnimator.setTrail(ball_1,300);
document.myAnimator.setFootPrints(ball_1,20);
document.myAnimator.setGhost(ball_1,true);
document.myAnimator.setTrail(ball_2,300);
document.myAnimator.setFootPrints(ball_2,20);
document.myAnimator.setGhost(ball_2,true);
document.myAnimator.setAutoRefresh(true);
document.myAnimator.forward();
}
</script>
</head>
<body onload="JavaScript:initialize()">
<h2>One dimensional motion with constant velocity.</h2>
<form name=myform>
<center>
<br>
<applet code="animator4.Animator.class"
codebase="../classes" id="myAnimator" name="myAnimator"
archive="Animator4_.jar,DataGraph4_.jar,STools4.jar"
width="500" height="200">
<param name="FPS" value="10">
<param name="dt" value="0.02">
<param name="pixPerUnit" value="10">
<param name="gridUnit" value="1.0">
<param name="showControls" value="false">
</applet>
<br>
<input type=button value="Run" onClick="Javascript:document.myAnimator.forward()"><input
type=button value ="Step Forward"onClick="Javascript:document.myAnimator.stepTimeForward()"
><input type=button value ="Step Backward" onClick="Javascript:document.myAnimator.stepTimeBack()"><input type=button
value="Pause" onclick=Javascript:document.myAnimator.pause()><input type=button
value="Reset" onclick="Javascript:document.myAnimator.reset()">
</center>
<p></form>
</body>
</html>