Read up on arctan. It might give you a few ideas...
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
There are several algorithms. Here are a couple...
N degree angle passing though point B is a line from + infinity to - infinity. Which side of the line is point A?
Inverse Tan y/x gives you the angle. of B-A
wildgoose
Practically a Posting Shark
896 posts since Jun 2009
Reputation Points: 546
Solved Threads: 99
Use fmod to handle angles set > < 360 degrees.
If you decide to use trig functions don't forget to convert degrees to radians.
PI is 180 degrees.
+/- PI.
wildgoose
Practically a Posting Shark
896 posts since Jun 2009
Reputation Points: 546
Solved Threads: 99