1

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

Samul
  • 127
  • Your question is confusing - there are two blue vectors. It looks as if you rotate clockwise to get to one of them, counterclockwise to get to the other. – Ethan Bolker Jan 23 '17 at 17:00
  • That's exactly what I need to know, how do I know if I have to turn CW or CCW my orange vector to get to one of each of the blue vectos. How MATHEMATICALLY can I know that to get the blue vector pointing right I should rotate my orange vector CW? – Samul Jan 23 '17 at 17:03
  • Your question is still ambiguous, you have an orange vector and both blue ones? Or does this blue one arise from somewhere and then you have to decide to rotate the orange one. You've given us no criteria for how you want to choose direction as you can take any 2D vector and rotate it both directions to get either of those blue ones – Triatticus Jan 23 '17 at 17:07
  • I think it's needed a formula bringing a sign indicating the least angle between two vectors. I was thinking of cross product of vectors with zero z component: if result z>0 counterclockwise, z<0 clockwise. It is possible to elaborte it easily. – Rafa Budría Jan 23 '17 at 17:08
  • 1
    This might help. $\mathbf u \cdot \mathbf v = |\mathbf u||\mathbf v|\cos\theta$ – Doug M Jan 23 '17 at 17:11
  • @Triatticus I have one orange vector and only one blue vector that can be the one pointing to the right or the one pointing to the left. If I have the blue vector pointing to the right, how can I know mathematically that I need to rotate my orange vector CW? – Samul Jan 23 '17 at 17:12
  • @Doug M. No, it doesn't help. In the case of the pic, both angles are popsitive. – Rafa Budría Jan 23 '17 at 17:13
  • @Doug M that formula does not help, the sign it outputs has no indication if I should turn CW or CCW. It only tells me the angle between the vectors but not if I have to rotate CW or CCW. – Samul Jan 23 '17 at 17:13
  • Oh ok so you want to have some way to decide which is the smaller angle to turn the vector – Triatticus Jan 23 '17 at 17:15

1 Answers1

2

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$.

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199