Finding angle of rotation relating two vectors to a third

Click For Summary
SUMMARY

This discussion focuses on calculating the angle of rotation between two 3D vectors, v1 and v2, around a third vector representing the Earth's magnetic field, h. The challenge lies in the fact that v1 and v2 may not lie on the same circle of rotation, necessitating the identification of the nearest point on the circle to v2, referred to as v1'. The solution involves defining an orthogonal Cartesian coordinate system with h aligned along the z-axis, and then projecting v2 onto the x-y plane to determine the angle relative to the x-axis.

PREREQUISITES
  • Understanding of 3D vector mathematics
  • Familiarity with cross product and dot product operations
  • Knowledge of orthogonal coordinate systems
  • Experience with vector projections in 3D space
NEXT STEPS
  • Study the properties of vector projections in 3D geometry
  • Learn about rotation matrices and their applications in 3D space
  • Explore the use of quaternions for representing rotations
  • Investigate the implications of vector transformations in physics simulations
USEFUL FOR

Mathematicians, physicists, computer graphics developers, and anyone involved in 3D modeling or simulations requiring vector manipulation and rotation calculations.

pvm
Messages
9
Reaction score
0
I have 2 vectors in 3d space, v1 and v2.
I also have a vector representing as it happens the direction of the Earth's magnetic field, called h.
i believe that v1 and v2 are related in that v2 is some rotation around h of v1.
i would like to find that angle of rotation.

i can't just find the shortest arc (by using the dot and cross products for eg), as this will not be around h in general.

To make matters worse, v1 and v2 won't necessarily be exactly on the same circle of rotation: just approximately on it. So really i'd like to find the angle of rotation around h that transforms v1 into v1', where v1' is the nearest point on that circle of rotation to v2, and THEN also find the length of the vector (gap) between v1' and v2.

Any ideas?
 
Physics news on Phys.org
I would approach it this way. I would define an orthogonal Cartesian coordinate system, lettinng h be along the z direction. Then unit vectors of my three axes, in terms of your vectors, could be something like this:
[tex] \mathbf{\hat{z}} = \frac{\mathbf{h}}{ |\mathbf{h}|}.[/tex]
[tex] \mathbf{\hat{y}} = \frac{\mathbf{h} \times \mathbf{v_1}}{|\mathbf{h} \times \mathbf{v_1}|}.[/tex]
[tex] \mathbf{\hat{x}} = \mathbf{\hat{y}} \times \mathbf{\hat{z}}.[/tex]
So that [itex]\mathbf{v_1}[/itex] only has x and z components; that is, the the projection of [itex]\mathbf{v_1}[/itex] onto the x-y plane coincides with the x axis.

Now, since the rotation is about the z axis, we just need to project [itex]\mathbf{v_2}[/itex] onto the x-y plane (that is, find the x and y components) and determine the angle
with repect to the x axis.

I hope that helps.

Jason
 
Jason - perfect. Thanks that's exactly what i needed. Had a feeling there would be a nice way to do it...

Many Thanks,
Paul
 

Similar threads

Replies
6
Views
2K
Replies
14
Views
2K
Replies
0
Views
2K
Replies
22
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K