1
$\begingroup$

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

  • 0
    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.2017-01-23
  • 0
    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?2017-01-23
  • 0
    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 ones2017-01-23
  • 0
    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.2017-01-23
  • 1
    This might help. $\mathbf u \cdot \mathbf v = \|\mathbf u\|\|\mathbf v\|\cos\theta$2017-01-23
  • 0
    @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?2017-01-23
  • 0
    @Doug M. No, it doesn't help. In the case of the pic, both angles are popsitive.2017-01-23
  • 0
    @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.2017-01-23
  • 0
    Oh ok so you want to have some way to decide which is the smaller angle to turn the vector2017-01-23

1 Answers 1

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

  • 0
    That is. The z component of the cross product. 6->counterclockwise.2017-01-23
  • 0
    I am gonna test this really simple formula (beautifull) if it works in all quadrants2017-01-23
  • 0
    @Samul you have to consider the zero result. In that case, you have to use the dot product.2017-01-23
  • 0
    if it's 0 I should not change direction, right?2017-01-23
  • 0
    They can be pointing at opposite directions2017-01-23
  • 0
    RIGHT right! You are correct! Could you tell me what is the "dot product"?2017-01-23
  • 0
    thanks you!!! Helped me a lot my friend2017-01-23