CalcWorldHub
Math · CalcWorldHub

Rotate a 3D Vector Around an Axis: Rodrigues’ Formula

Rotate v=(1,0,0) by +90° around k=(0,0,1): the result is (0,1,0). Rodrigues’ formula handles any nonzero axis by normalizing it internally, then combining the original vector, an axis cross product, and the component parallel to the axis. The calculator reports the rotated vector and its preserved magnitude.

Open calculator
A vector turns from the x direction toward y around a vertical z axis with a right-hand-rule arc.

Share this article

A vector rotates around a vertical axis from the positive x direction toward positive y, with a marked right-hand-rule arc.
Use the directed axis to determine the sign of the perpendicular turn.

Read the axis and angle convention

Rodrigues’ formula rotates a vector around a directed axis through the origin. First make the axis a unit vector k̂=k/||k||. For angle θ, v′=v cosθ+(k̂×v)sinθ+k̂(k̂·v)(1−cosθ). The order in the cross product matters: k̂×v follows the right-hand convention used by the calculator.

The angle field is in degrees. A positive angle follows the right-hand rule around the directed axis; reversing the axis direction reverses the effective orientation for the same positive angle. The axis may have any nonzero magnitude because the implementation normalizes it before using it.

Understand the three terms

The first term retains the part of v aligned with the original vector, scaled by cosθ. The cross-product term supplies the perpendicular turning direction and scales with sinθ. The final term accounts for the component parallel to the rotation axis, which should remain unchanged. Together these pieces rotate around the axis without stretching the vector.

When v is parallel to the axis, its cross product with k̂ is zero and the parallel component remains fixed. When v is perpendicular, the parallel term vanishes and the vector turns within the perpendicular plane. These cases provide simple checks for signs and orientation before working with a general vector.

Worked examples

Example 1 · rotate x toward y

Inputs: v=(1,0,0), k=(0,0,1), θ=90°.

Calculation: k̂×v=(0,1,0); the parallel component is zero; cos90°=0 and sin90°=1.

v′=(0,1,0); magnitude remains 1.

Example 2 · preserve the axial component

Inputs: v=(1,2,3), k=(0,0,5), θ=90°.

Calculation: Normalize k to (0,0,1); rotate the x-y pair while the z component remains 3.

v′=(−2,1,3); both magnitudes are √14≈3.74166.

A positive 90 degree rotation around the positive z-axis sends the unit x vector to the unit y vector.
The cross-product order fixes the right-hand orientation.

Work through a right-angle turn

With v=(1,0,0), k̂=(0,0,1), and θ=90°, cosθ=0 and sinθ=1. The cross product k̂×v is (0,1,0), while k̂·v=0. The result is therefore (0,1,0). A negative 90° angle would turn the x direction toward negative y under this axis convention.

For a general vector v=(1,2,3), the same +90° rotation about the z-axis gives (−2,1,3): the x-y components rotate in their plane while z stays fixed. Its original length is √14, and the rotated length remains √14. This separates a genuine rotation from a transformation that scales or shears the vector.

Keep the pivot assumption clear

The tool rotates a vector around an axis through the origin. If the task is to rotate a point around an axis that passes through another point A, translate the point by subtracting A, rotate that displacement, then add A back. The current form does not accept a pivot point or apply those translations automatically.

This distinction matters in graphics, robotics, and rigid-body geometry. A direction vector can be rotated directly because its location is irrelevant; a position point changes with the chosen pivot. Do not interpret the calculator result as the transformed coordinates of an offset object unless the origin is in fact on the rotation axis.

Magnitude, units, and numerical limits

A rotation preserves Euclidean magnitude. The rotated vector has the same component units as the input vector, and the direction axis is dimensionless for the formula. The calculator also returns the original and rotated magnitude to eight decimal places as a check. Small discrepancies in the displayed components can result from decimal rounding or floating-point sine and cosine values.

The axis must be nonzero; the vector being rotated may be zero, in which case it stays zero. Extremely large components may exceed finite arithmetic limits. For ordinary values, if the reported length changes materially, check that the angle was entered in degrees and that the axis and vector component orders are correct.

Verify direction and preservation

For a hand check, normalize the axis, evaluate its dot and cross products with v, and use the same θ in all three formula terms. Confirm that the parallel component is unchanged and that the final magnitude matches the original. For a 90° test around the positive z-axis, x should rotate toward positive y; reversing the angle should reverse that turn.

The sign of the cross-product term is a common source of mistakes. Using v×k̂ instead of k̂×v gives the opposite perpendicular direction. A quarter-turn test with the coordinate basis vectors makes the convention visible. The published calculation uses the axis-first cross product and a right-handed frame, so keep that order when reproducing it.

Sources and further reading

Share this article

Browse all articles · Calculator: 3D vector axis angle rotation calculator