topical media & game development
math: animation(s)
- sine = opposite / hypotenuse
[03]
- cosine = adjacent / hypotenuse
- tangent = opposite / adjacent
- radians = degrees * Math.PI / 180
- degrees = radians * 180 / Math.PI
- rotation = Math.atan2(dy,dx) * 180 / Math.PI
- distance = Math.sqrt(dx*dx + dy*dy);
- (rotational) vx = speed * Math.cos(angle);
[05]
- (rotational) vy = speed * Math.sin(angle);
- (rotational) ax = force * Math.cos(angle);
- (rotational) ay = force * Math.sin(angle);
- x1 = Math.cos(angle) * x - Math.sin(angle) * y;
[10]
- y1 = Math.cos(angle) * y + Math.sin(angle) * x;
- distance = Math.sqrt(dx*dx + dy*dy + dz*dz);
[15]
assumption(s) -- dx = ms.X - spr.x; dy = ms.Y - spr.y;

(C) Æliens
27/08/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.