What this calculator does
The 3D Coordinate Rotation Calculator finds the new position of a point in three-dimensional space after you rotate it about the X, Y and/or Z axis. It uses a right-handed coordinate system and the right-hand-rule sign convention, so a positive angle rotates the point counterclockwise when you look down the positive end of the rotation axis toward the origin. This is pure analytic geometry and applies universally — to physics, robotics, computer graphics, CAD and engineering alike.
How to use it
Enter the starting coordinates (Initial x, y, z) of your point. Choose whether your angles are in degrees or radians. Then define up to three rotation steps, each with an axis and an angle. Steps are applied in order: Step 1 acts on the original point, Step 2 acts on the result of Step 1, and so on. Leave an angle blank or set it to 0 to skip that step. For a single rotation, just fill in Step 1.
The formula explained
For each step, let theta be the angle in radians, with \(c = \cos\theta\) and \(s = \sin\theta\). Rotation about the Z axis keeps \(z\) fixed and maps \((x, y)\) to \((x\cdot c - y\cdot s,\; x\cdot s + y\cdot c)\). Rotation about X keeps \(x\) fixed; rotation about Y keeps \(y\) fixed, each mixing the other two coordinates the same way. Composing several rotations is the same as multiplying their rotation matrices, but applying them step by step to the vector avoids ordering mistakes.
$$R_z(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}$$Rotation about the X axis:
$$\begin{aligned} x^{\prime} &= x \\ y^{\prime} &= y\cos\theta - z\sin\theta \\ z^{\prime} &= y\sin\theta + z\cos\theta \end{aligned}$$Rotation about the Y and Z axes:
$$\begin{aligned} x^{\prime} &= x\cos\theta + z\sin\theta,\; y^{\prime}=y,\; z^{\prime}=-x\sin\theta + z\cos\theta \\ x^{\prime} &= x\cos\theta - y\sin\theta,\; y^{\prime}=x\sin\theta + y\cos\theta,\; z^{\prime}=z \end{aligned}$$
Worked example
Take the point \((1, 0, 1)\) and rotate it 90° about the Z axis. Here \(\theta = \pi/2\), so \(c = 0\) and \(s = 1\). Then
$$x' = 1\cdot 0 - 0\cdot 1 = 0,\quad y' = 1\cdot 1 + 0\cdot 0 = 1,$$and \(z'\) is unchanged at \(1\). The result is \((0, 1, 1)\).
Common Rotation Angle Values
The entries of every rotation matrix depend only on \(\cos\theta\) and \(\sin\theta\). The table lists exact values for the most common angles so you can substitute them directly into \(R_X\), \(R_Y\) or \(R_Z\). Decimal approximations are shown to four places.
| \(\theta\) (deg) | \(\theta\) (rad) | \(\cos\theta\) | \(\sin\theta\) |
|---|---|---|---|
| 0° | 0 | 1 | 0 |
| 30° | \(\pi/6\) | \(\tfrac{\sqrt3}{2}\approx0.8660\) | \(\tfrac12=0.5\) |
| 45° | \(\pi/4\) | \(\tfrac{\sqrt2}{2}\approx0.7071\) | \(\tfrac{\sqrt2}{2}\approx0.7071\) |
| 60° | \(\pi/3\) | \(\tfrac12=0.5\) | \(\tfrac{\sqrt3}{2}\approx0.8660\) |
| 90° | \(\pi/2\) | 0 | 1 |
| 180° | \(\pi\) | −1 | 0 |
| 270° | \(3\pi/2\) | 0 | −1 |
Note that a \(180^\circ\) rotation flips the sign of the two coordinates perpendicular to the axis, while \(270^\circ\) is equivalent to \(-90^\circ\) (a quarter turn in the clockwise sense when viewed down the positive axis).
Key Terms & Variables
- Right-handed coordinate system
- A 3D frame in which the X, Y and Z axes are oriented so that pointing the right hand's fingers from +X toward +Y makes the thumb point along +Z. The standard mathematical and physics convention; these rotation matrices assume it.
- Right-hand rule
- A mnemonic for the positive sense of rotation: point the right thumb along the positive axis of rotation, and the curl of the fingers gives the positive (counterclockwise) direction of rotation for that axis.
- Rotation matrix
- A \(3\times3\) orthogonal matrix with determinant \(+1\) that rotates vectors about a fixed axis without changing their length. Here \(R_X\), \(R_Y\) and \(R_Z\) rotate about the X, Y and Z axes respectively.
- \(\theta\) (theta), the rotation angle
- The amount of rotation about the chosen axis. Entered in degrees or radians; the tool converts degrees internally with \(\theta_{\text{rad}} = \theta_{\text{deg}}\cdot\pi/180\) before evaluating \(\cos\theta\) and \(\sin\theta\).
- Axis of rotation
- The fixed line (X, Y or Z) that points on it remain unchanged while everything else turns around it. In this tool each step's axis is selected as 0 = X, 1 = Y, 2 = Z.
- Positive / counterclockwise direction
- A positive angle produces a counterclockwise rotation when looking from the positive end of the axis back toward the origin. A negative angle reverses it (clockwise).
- Output coordinates \(x'\), \(y'\), \(z'\)
- The components of the rotated point \(\mathbf{p}' = R\,\mathbf{p}\). With one or more sequential rotations, \(\mathbf{p}' = R_{a_3}(\theta_3)\,R_{a_2}(\theta_2)\,R_{a_1}(\theta_1)\,\mathbf{p}\), where the rightmost matrix is applied first.
FAQ
What is positive rotation direction? Positive means counterclockwise when viewed from the positive axis looking toward the origin (the right-hand rule).
Does the order of rotations matter? Yes. 3D rotations do not commute, so rotating about X then Z generally differs from Z then X. This tool applies Step 1 first.
Why do some results show 0 instead of a tiny number? Values like \(\cos(90°)\) are not exactly 0 in floating point, so near-zero outputs are cleaned to 0 for clarity.