Left or Right Angles ( + or - ) of adjoining vectors

  • Context: MHB 
  • Thread starter Thread starter BrentK
  • Start date Start date
  • Tags Tags
    Angles Vectors
Click For Summary
SUMMARY

This discussion focuses on determining the angle between two adjoining vectors in a 2D coordinate system, specifically whether the angle is positive (left) or negative (right). The user seeks a formula to calculate this angle based on the coordinates of the vectors. The solution involves using the inner product of the rotated leading vector and the adjoining vector, with specific conditions established for left and right angles based on the inequality of the calculated expressions.

PREREQUISITES
  • Understanding of vector mathematics and operations
  • Familiarity with 2D coordinate systems
  • Knowledge of inner products and their geometric interpretations
  • Basic proficiency in mathematical inequalities
NEXT STEPS
  • Study vector rotation techniques in 2D space
  • Learn about inner products and their applications in geometry
  • Explore mathematical inequalities and their use in vector analysis
  • Research additional vector operations, such as cross products in 3D
USEFUL FOR

Mathematicians, computer graphics developers, game developers, and anyone involved in physics simulations or vector analysis.

BrentK
Messages
20
Reaction score
0
Hi there,
I have another one for you (Blush)

How can I efficiently determine if the angle between 2 vectors is positive or negative...
Take a look at this example drawing:

View attachment 8685

Known are the xy coordinates of 2 adjoining vectors, (I also have calcullated the 360 deg angle relative to the x-axis if that is a help ... shown with grey arrows on the drawing)
In the drawing the leading vector (Red) as adjoined to either a vector giving a positive or (left) angle, or a vector in the negative direction (right) angle.

I need to be able to calculate if the adjoining vector is a positive or negative angle in relation to the leading vector... sounds simple right? and proabably is, but I just don't seem to be able to get it right with all different vector direction possibilities

The formula should calculate all possibilites of two adjoining vectors, so e.g. could also be heading in the opposite direction where x1y1 is less than x0y0... hope you understand what i mean :)

Look forward to any help yo may be able to provide.
Many thanks, This forum has been a great help to me!
 

Attachments

  • Unbenannt.JPG
    Unbenannt.JPG
    9.9 KB · Views: 135
Mathematics news on Phys.org
Start with the red vector, which is $\begin{bmatrix}x_1-x_0 \\ y_1-y_0\end{bmatrix}$. If you rotate it "to the left" (in other words, anticlockwise) by $90^\circ$ then it becomes $\begin{bmatrix}y_0-y_1 \\x_1-x_0\end{bmatrix}$. You want to know whether the inner product of that vector with the blue vector $\begin{bmatrix}x_2-x_1 \\ y_2-y_1\end{bmatrix}$ is positive. So the condition you need is $$x_0(y_1-y_2) + x_1(y_2-y_0) + x_2(y_0-y_1) > 0 \quad \text{for "left",}$$ $$x_0(y_1-y_2) + x_1(y_2-y_0) + x_2(y_0-y_1) < 0 \quad \text{for "right".}$$
 
Thanks again Oplag!
That worked fine...
Now I have found a new challenge... If you are willing,I'd appreciate you take a look at my new post.

I really appreciate your help. I'm not that great at Maths...I'm trying hard and learning, but this task is very hard for me! Without you and the help of others on this forum, I'd be totally lost!
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 18 ·
Replies
18
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
6K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
1
Views
2K
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K