How to know where to turn this vector

75 Views Asked by At

I have well defined position of an orange vector. Suppose I have two other vectors (blue in the image), how can I know where to turn my orange vector in order to get the same orientation as the blue vectors?

I dont want to know how much I have to turn, I just want to know: should I turn my orange vector clockwise or anticlockwise? Is there a mathematical equation that lets me know this?

enter image description here

1

There are 1 best solutions below

7
On BEST ANSWER

The determinant of the matrix with columns the two vectors you care about calculates the signed area of the parallelogram they generate. $$ \det \begin{bmatrix} 1 & 3 \\ 3 & 3 \end{bmatrix} = -6, $$ $$ \det \begin{bmatrix} 4 & 3 \\ 2 & 3 \end{bmatrix} = 6 . $$

The dot product of the two vectors will tell you the angle $\theta$ between them: $$ (4,2) \cdot (3,3) = 4 \times 3 + 2 \times 3 = 18 = ||(4,3)||\times||(3,3)||\cos(\theta) $$ where $||v||$ is the length of vector $v$.