Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

that algoritmh is to make a cannon rotate over a plot... var g = setInterval('rotateMe',speed) function rotateMe() { x = |length| Math.cos(t) y = |length| Math.sin(t) plot = 'position:absolute; top:y; left:x' document.getElementById('img').position = plot t = t+angle of rotation } something went wrong with this algorithm need checker ^^

OpenStudy (mattfeury):

You'll have to do something like this. You're wanting to edit the style attribute: document.getElementById('img').style.position = "absolute"; document.getElementById('img').style.top = y; document.getElementById('img').style.left = x;

OpenStudy (anonymous):

kk but its not the code only algorithm ^^

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!