Hey everyone,
I was just discussing a Flash issue involving trigonometry with Dauntless, a young and promising actionscripter I met over at FlashFocus.nl. He was busy working on a solution to a problem a member had, how to fire missiles given a random swirly path. Smee came up with a brilliant solution involving lots of trigonometry.
So afterwards, he came to me for further explanation of the code. He was especially puzzled by the atan2 function, and why it does work with a minus in front and if you switch target._y - position._y. So I figured it might be nice to provide a theoretical background to the members as to how this actually works, why it works and what the idea behind it is.
I know Sen has a chapter on trigonometry in his (most excellent) 3D tutorial, but that’s more geared towards the 3D part - I’d like to provide actual mathematical information as to how it’s applied in Flash and using radiants, and how to apply it with the _rotation property etc.
What do y’all think ? Waste of time, or good idea ?