Direction of a vector relative to another vector?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 5K views
snocavotia
Messages
11
Reaction score
0
Hello, I have two vectors, the angle between them is dynamic and constantly changing. I have found a way to calculate the angle between these two vectors. But this angle is always a positive number even if i am looking left or right. How can i get context(wether vector DC,DB,DE,DF according to the image below) is to the right of vector DA or to the left of it?
http://oi42.tinypic.com/2prwfo0.jpg
 
Physics news on Phys.org
If you define the angle anti-clockwise from DA, then it will always be a positive number - yeah.

You want your domain to go from -180 to 180 deg, then you need to handle the case where the vector is at +170deg and you rotate it +20deg (in the positive rotation direction) to put is at -170deg.

But when the angle is constantly changing you are better off with the standard approach.
Note - ##+3\pi/2= -\pi/2## ... you should get negative angles if the vector rotated the opposite way.