I have two two-dimensional unit vectors a and b. I'm trying to get their angle related to their order. arc cosine of the dot product returns the absolute value of the angle. if b is before a I want to get negative angle.
e.g. if a is on 1 o'clock and b is on 2 o'clock I want to get answer of 30 degrees but if a is on 2 o'clock and b is on 1 o'clock I want to get answer of -30 degrees. answers should be in radians, I used degrees for simpler explanation.
How can I do this? a method for finding who is before who will be good enough. this is for an application, so an answer of "just look at them" won't work, but a mathematical relation will be good (e.g. some equation that is negative only if b is before a).
Tell me more
×
Mathematics Stack Exchange is a question and answer site for
people studying math at any level and professionals in related fields. It's 100% free, no registration required.
|
|
|||||||||
|
|
Treat them as 3D vectors with $z=0$ and find the cross product. |
|||||||
|