Circle
Circle
<script type="text/javascript">
<!--
// CIRCLE
R0=50 // Radius
A=0 // Rads. 1 degree = 3.14150/180 radians
cx=parseInt(document.getElementById("cir").style.left) // use for positioning left
cy=parseInt(document.getElementById("cir").style.top) // use for positioning top
function orbit(){
A=A+.05 // Increase angle adding .1 each time. Change direction by subtracting.
c=Math.cos(A)
s=Math.sin(A)
x=(R0*c)+cx // new x coordinates
y=(R0*s)+cy // new y coordinates
document.getElementById("cir").style.left=x
document.getElementById("cir").style.top=y
setTimeout("orbit()",30)
}
orbit()
// -->
</script>
<span id="cir" style="position:absolute; top:160; left:200;z-index:2">[ + ]</span>
Left & Right
Left & Right
<script type="text/javascript">
<!--
//Left & Right
R2=100 // Radius
A2=0 // Starting angle. Angles are in Radians. 1 degree = 3.14150/180 radians
posx2=parseInt(document.getElementById("LR").style.left)
posy2=parseInt(document.getElementById("LR").style.top)
function orbit2(){
A2=A2+.05 // Increase angle adding .05 each time. Change direction by subtracting.
b2=Math.cos(A2)
//pos2=Math.sin(A2)
x2=(R2*b2)+posx2
//y2=(R2*c2)+cy2
document.getElementById("LR").style.left=x2 // Position
document.getElementById("LR").style.top=posy2
setTimeout("orbit2()",30)
}
orbit2()
// -->
</script>
<span id="LR" style="position:absolute; top:160; left:250;">O</span>
<script type="text/javascript">
<!--
//Diag
R3=50 // Radius
A3=0 // Starting angle. Angles are in Radians. 1 degree = 3.14150/180 radians
cx3=parseInt(document.getElementById("diag").style.left)
cy3=parseInt(document.getElementById("diag").style.top)
function orbit3(){
A3=A3+.05 // Increase angle adding .05 each time. Change direction by subtracting.
b3=Math.sin(A3)
c3=Math.sin(A3)
x3=(R3*b3)+cx3
y3=(R3*c3)+cy3
document.getElementById("diag").style.left=x3 // Position the object.
document.getElementById("diag").style.top=y3
setTimeout("orbit3()",30)
}
orbit3()
// -->
</script>
<span id="diag" style="position:absolute; top:100; left:300;">O</span>