How to determine whether V3 is between V1 and V2 when we go from V1 to V2 counterclockwise?

后端 未结 5 2056
鱼传尺愫
鱼传尺愫 2021-01-12 15:37

I have three vectors V1, V2, and V3. Their origin points are on the axes\' origin. How could I determine whether V3 is between V1 and V2 when I move around counterclockwise

5条回答
  •  旧时难觅i
    2021-01-12 16:06

    V1 is a red herring. You're just going to confuse yourself thinking about 3 angles at once.

    1. Rotate everything clockwise by angle(V1)
    2. Normalize the remaining two angles to [0,360)

    Now the question is simply to compare norm(angle(V2)-angle(V1)) and norm(angle(V3)-angle(V1)).

提交回复
热议问题