Direction of a vector relative to another vector?

Click For Summary
SUMMARY

The discussion focuses on determining the directional context of one vector relative to another in a dynamic environment. The user has successfully calculated the angle between two vectors but seeks to identify whether the second vector is to the left or right of the first vector. The solution involves adjusting the angle range to span from -180 to 180 degrees, allowing for negative angles when the second vector rotates in the opposite direction. The discussion emphasizes the importance of using standard approaches for continuously changing angles.

PREREQUISITES
  • Understanding of vector mathematics
  • Familiarity with angle measurement and rotation
  • Knowledge of trigonometric functions
  • Experience with programming concepts for dynamic calculations
NEXT STEPS
  • Research how to implement angle normalization in programming languages
  • Learn about vector cross products to determine directional context
  • Explore the use of atan2 function for angle calculations
  • Investigate the implications of rotating vectors in 2D and 3D spaces
USEFUL FOR

This discussion is beneficial for mathematicians, computer graphics developers, and anyone working with physics simulations or game development that requires understanding vector relationships and rotations.

snocavotia
Messages
11
Reaction score
0
Hello, I have two vectors, the angle between them is dynamic and constantly changing. I have found a way to calculate the angle between these two vectors. But this angle is always a positive number even if i am looking left or right. How can i get context(wether vector DC,DB,DE,DF according to the image below) is to the right of vector DA or to the left of it?
http://oi42.tinypic.com/2prwfo0.jpg
 
Physics news on Phys.org
If you define the angle anti-clockwise from DA, then it will always be a positive number - yeah.

You want your domain to go from -180 to 180 deg, then you need to handle the case where the vector is at +170deg and you rotate it +20deg (in the positive rotation direction) to put is at -170deg.

But when the angle is constantly changing you are better off with the standard approach.
Note - ##+3\pi/2= -\pi/2## ... you should get negative angles if the vector rotated the opposite way.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K