-
I want to find the angle between 2 points. For
example, i am at point (1,2), and i want to be at (8,6).
First i need to rotate X degrees, until i face my
destination, then move N spaces, until i am there.
So, to make a right triangle, i take Point1.Y (2) and
Point2.X (8) to form the right angle at (8,2). Any
algorithm for this?
-
Check out my sample rotation using guv's safe arctangent function:
http://forums.vb-world.net/showthrea...threadid=53924
If you want to rotate 90 degrees you switch dx and dy as follows:
to the left
x = cx + dy
y = cy - dx
to the right
x = cx - dy
y = cy + dx
-
I figured it out last night, but thanks kedaman. =)