guache Posted August 28, 2017 Share Posted August 28, 2017 (edited) In Vex, I'm trying to find a signed angle between two vectors i.e. an angle which treats one vector as a "base" and the other as a rotating "clock hand", so that I get positive angle for a concave angle between the two (0-180 deg) and a negative angle for a convex angle between the two (180-360 deg). The dot product on normalized vectors gives me the angle, but it's symmetric. Is there a trick that gets me the sign? Edited August 28, 2017 by guache Quote Link to comment Share on other sites More sharing options...
f1480187 Posted August 28, 2017 Share Posted August 28, 2017 Quote Link to comment Share on other sites More sharing options...
guache Posted August 28, 2017 Author Share Posted August 28, 2017 Cool, thanks. Quote Link to comment Share on other sites More sharing options...
kefex Posted August 29, 2017 Share Posted August 29, 2017 If v is your base, and w the clock hand, and n is a reference vector perpendicular to both (this is necessary if you want an angle in 0-360), then the angle is given as atan2(dot(cross(n,v), w), dot(v,w)); 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.