Jump to content
  • Advertisement
Sign in to follow this  
Ebola0001

formula question (finding the angle between two vectors)

This topic is 4282 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

The tutorial on the triple buffer math primer, lists the formula to find the angle between two vectors (V and U) as... V.U = |V| * |U| * cos(angle) My question is in order to get the angle from two vectors, I think I need to do... acos(|U| / |V| / (V.U)) = angle Is this right?

Share this post


Link to post
Share on other sites
Advertisement
V.U = |V| * |U| * cos(angle)

V.U / cos(angle) = |V| * |U|

1 / cos(angle) = (|V| * |U|) / (V.U)

cos(angle) = (V.U) / (|V| * |U|)

angle = acos((V.U) / (|V| * |U|))

i think, unless i screwed something up in the math there...have a tendency to forget stuff when doing math, especially when trig's involved :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!