A Quick Look Into The Math Of Animations With JavaScript
coding.smashingmagazine.com
coding.smashingmagazine.com
This is the magic sauce you need. (more visual demo here: http://sol.gfxile.net/interpolation/index.html)
Compared to serious mathematics, programming is relatively trivial.
With mathematics, you can do anything in computing.
Without it, you're reduced to this feeble exercise in self-enlightment.
As humans, however, degrees ranging from 0 to 360 are much easier to read. That’s why you can and should convert between them with this simple formula.
Made be cringe.It's not precomputed server-side, it's precomputed when the fade effect is called in the JS. The value for each step is then stored in the task object that performs the fade. Which is cheating a little bit, I suppose, but this way, I can fade from any value to any value, at what appears to be the same "speed", without any glitching.
I played with Javascript sine animations as a way of introduce the idea of sine function in some intuitive way.
Eg Two Rotating Circles - http://quantblog.wordpress.com/2011/10/05/adding-circles-jav...
I think Javascript hacking in a web page is todays equivalent to hacking GW-Basic, Turbo Pascal or A86 assembler for my generation.
posX += (destX - posX)/ slowdownRate
Moves an item like so: X....X...X..X.X