I’ve added a simple Trig class to RedLib. Provides easy access to common trig calculations for use in AS3.
- Calculate Distance between two objects.
- Calculate angle of an object reletive to another. Useful for pointing a MovieClip at another MovieClip.
- Convert radians to degrees and degrees to radians.
- Calculate X and Y coordinates given a distance and radius from an Object.
- More to be added.
Source available in Google code here.
Update: Looks like some dude, Sekati, has a Trig class almost identical to this one. Check it out on google code. The rest of his library is pretty snazzy, too. On a side note, even though you may end up using an existing library, it’s always to good to try it yourself first. You learn more that way.
