# Rotating vector x around vector z

• ddr
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.
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;

correction

actually y=croos_vector(z,(x-xonz))/|x-xonz|^2

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:

## 1. 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.

## 2. 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.

## 3. 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.

## 4. 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.

## 5. 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.

• General Math
Replies
1
Views
1K
• General Math
Replies
2
Views
1K
• General Math
Replies
3
Views
1K
• General Math
Replies
17
Views
2K
• General Math
Replies
7
Views
1K
• General Math
Replies
1
Views
840
• General Math
Replies
5
Views
399
• Linear and Abstract Algebra
Replies
1
Views
688
• General Math
Replies
10
Views
1K
• General Math
Replies
1
Views
739