« Why Geometry and I Don’t Get Along Dynamic Event Handlers with Flash MX »

Easier Animation through Trigonometry

October 17 2004

I suspected that there was an easier equation for movement within a circle and I finally found it here, kirupa.com - Trigonometry included in a nice tutorial. The key is using the radian measurement along with the trigonometric functions, sine and cosine. As explained, the standard equations to determine x and y positions are:

clip._x = originx + Math.cos(angle)*radius;

and

clip._y = originy + Math.sin(angle)*radius;

.

As I determined before, the radius is half of the difference between starting and ending x-value.

Comments ()