Maintain angle between two 3D vectors after rotation(s)

77 Views Asked by At

In a 3D cartesian space, I have two vectors. One vector is a static unmoving vector—let’s call it S. The other vector is the vector I need to rotate—let’s call it R. Both vectors have their tail as the origin (0,0,0) and their head at an arbitrary position. Let’s name the current (original) angle between the two vectors A1.

I am going to perform a rotation that will result in the angle between R and S changing. I will then need to adjust R with a second transformation so that the new angle is equal to the old angle, without changing R's direction on the XY plane. What is the procedure and equations to determine/make this second transformation?

Details:

  • Rotate R by some arbitrary degree (call it θ) in the XY plane (i.e. rotate round the Z-Axis). The rotation may be clockwise or counter-clockwise.
  • However, once I rotate R in the XY plane the angle between S and R will, for almost all values of θ, change.
  • I need to maintain the original angle (A1) between S and R. However I also need to maintain R's newly established direction (i.e. direction post-rotation) along the XY Plane.
  • What transformation (I presume a series of rotations) do I need to perform, such that the resulting angle (A2) between S and R is equal to the original angle (A1), while maintaining R's direction on the XY plane?
  • The magnitude (length) of vector R must not change.

Note: I'm not a "math person" but instead someone who needs to write some functioning code to handle this in a program, so please don't presume too much knowledge on my part. Understanding the equations is important. Some terminology may need to be explained. Basically "showing the work" would help me understand.

Thank you!

1

There are 1 best solutions below

1
On

Use dot products for angles between vectors and cross-products for oriented angles between vectors. If $\mathbf {u.v}$are column-vectors then $ \mathbf{u^tv=u \bullet v}$ If $A$ is an orthogonal matrix then $(A \mathbf u) \bullet (A\mathbf v)=\mathbf{u \bullet v}$. Rotation matrices in 2- or 3-space (about the origin) are orthogonal matrices with determinant 1. If $A$ is a rotatation matrix, then $(A \mathbf u)\times (A\mathbf v)=A(\mathbf{u \times v})$.