Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

kc_0045

direction to point?

This topic is 5334 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey im having some problems trying to make a function that well return the angle between to points i 2d like heres a eg directionpoint(0,0,0,-10); and it would return 90 thats if the y was going up :D is there anyway of doing this?

Share this post


Link to post
Share on other sites
Advertisement
math and pysics is probably a better forum.

Someone who knows matrices off the top of their head will tell you the exact operations necessary to find the angle between two vectors.

Share this post


Link to post
Share on other sites
Dot products and magnitudes, and google, oh my.

http://www.jtaylor1142001.net/calcjat/Solutions/VDotProduct/VDPTheta3D.htm

Edit: Err... Dot product, not Cross.

[edited by - Thrump on April 12, 2004 1:12:17 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
dir = atan2(x2-x1, y2-y1)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!