sparkChan Posted June 7, 2011 Share Posted June 7, 2011 hi, everyone. I have two vectors, and I want to get the angle between them in the vopsop. so what should I do? thanks Quote Link to comment Share on other sites More sharing options...
sanostol Posted June 7, 2011 Share Posted June 7, 2011 angle(in radians) = acos(dot(normalize(vector1), normalize(vector2))) Quote Link to comment Share on other sites More sharing options...
Macha Posted June 7, 2011 Share Posted June 7, 2011 Use the dot product. To get degrees run it through the arc cosine and then from radians to degrees. I think the vectors need to be normalized but I'm not sure. Quote Link to comment Share on other sites More sharing options...
Macha Posted June 7, 2011 Share Posted June 7, 2011 Hey Sanostol. Nice illustration of 2 ways of thinking to explain the same thing. Quote Link to comment Share on other sites More sharing options...
sparkChan Posted June 7, 2011 Author Share Posted June 7, 2011 angle(in radians) = acos(dot(normalize(vector1), normalize(vector2))) thanks for replying quickly! I'v got it in the vopsop. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.