MichaelSpectre
Member
- Joined
- Feb 26, 2012
- Messages
- 11
- Location
- Visalia, California, United States
- Programming Experience
- 10+
A 2D object has an x/y location, x/y direction, and a velocity.
During each update, its location = (location + (direction * velocity)).
This enables it to travel in any and all directions at varying speeds.
Using this information, how would you find the angle (in degrees, from 0 to 360) between it's current location, and it's next location, and then use that to determine it's heading (N, S, E, W, NE, NW, SE, or SW)?
During each update, its location = (location + (direction * velocity)).
This enables it to travel in any and all directions at varying speeds.
Using this information, how would you find the angle (in degrees, from 0 to 360) between it's current location, and it's next location, and then use that to determine it's heading (N, S, E, W, NE, NW, SE, or SW)?