Rotating vector x around vector z

In summary, rotating a vector x around a vector z involves performing a transformation that changes the orientation of x with respect to z. This process is commonly used in computer graphics and animation to create 3D effects and simulate rotations in virtual environments. The rotation can be defined by an angle or a rotation matrix, and can be applied to both 2D and 3D vectors. The resulting rotated vector will have the same magnitude as the original vector, but its direction will be changed according to the rotation.
  • #1
ddr
Is this how it should be done (rotating vector x around vector z for alpha degrees):
assumes |x|*|z|<>0
xonz=(scalar_product(z,x)/(|x|*|z|))*z;
y=x-xonz;
assumes |x|<>0
result=cos(alpha)*x+sin(aplha)*(|y|/|x|)*y;
 
Mathematics news on Phys.org
  • #2
correction

actually y=croos_vector(z,(x-xonz))/|x-xonz|^2
 
  • #3
Not quite. I should say:

answer = xonz + y cos [alpha] + z/|z| X y sin [alpha].

Where X means vector product. And y = x - xonz.

Note: There should be a simpler form to this. Try yourself, please!
 
Last edited:

FAQ: Rotating vector x around vector z

How do you rotate a vector around another vector?

To rotate a vector x around another vector z, you can use the cross product formula: x' = x * cosθ + (z x x) * sinθ + z * (z · x) * (1 - cosθ), where x' is the rotated vector, θ is the angle of rotation, and · represents the dot product.

What is the purpose of rotating a vector around another vector?

The purpose of rotating a vector around another vector is to change the direction of the vector while keeping its magnitude unchanged. This operation is commonly used in computer graphics, physics, and engineering applications.

Can you rotate a vector around any arbitrary vector?

Yes, you can rotate a vector around any arbitrary vector as long as the two vectors are not parallel. If the two vectors are parallel, the rotation will result in the same vector.

How does the direction of rotation affect the resulting vector?

The direction of rotation affects the resulting vector by changing the sign of the angle of rotation. A positive angle of rotation will result in a counterclockwise rotation, while a negative angle will result in a clockwise rotation.

Is there a difference between rotating a vector around a fixed point and rotating it around another vector?

Yes, there is a difference between rotating a vector around a fixed point and rotating it around another vector. When rotating around a fixed point, the vector will rotate around that point in a circular motion. However, when rotating around another vector, the vector will rotate around an axis that is perpendicular to both the original and the rotating vectors.

Similar threads

Replies
1
Views
1K
Replies
2
Views
2K
Replies
3
Views
1K
Replies
1
Views
1K
Replies
3
Views
2K
Replies
1
Views
917
Back
Top