- 2066 Magh (old course)
Cube spinning 180° about z-parallel axis
Short answer
Translate centre to origin, rotate 180° about z, translate back. Matrix: x' = 2-x, y' = 2-y, z' = z, or M = [[-1,0,0,2],[0,-1,0,2],[0,0,1,0],[0,0,0,1]].
A 2 units length cube with a diagonal passing through (0,0,0) and (2,2,2) is spinning about an axis parallel to z-axis with angle 180 degree. Obtain the matrix involved for the operation.
Assumption: the cube has side 2 with opposite corners (0,0,0) and (2,2,2). The axis is parallel to the z-axis and passes through the centre of the cube, so the axis is the line x = 1, y = 1. (Rotating about an axis through the centre keeps the cube in place.)
Method: translate the axis to the z-axis, rotate by 180° about z, translate back.
M = T(1, 1, 0) · Rz(180°) · T(−1, −1, 0)
cos180° = −1, sin180° = 0
T(1,1,0) Rz(180°) T(-1,-1,0)
| 1 0 0 1 | | -1 0 0 0 | | 1 0 0 -1 |
| 0 1 0 1 | | 0 -1 0 0 | | 0 1 0 -1 |
| 0 0 1 0 | | 0 0 1 0 | | 0 0 1 0 |
| 0 0 0 1 | | 0 0 0 1 | | 0 0 0 1 |
Multiplying:
M = | -1 0 0 2 |
| 0 -1 0 2 |
| 0 0 1 0 |
| 0 0 0 1 |
So x' = 2 − x, y' = 2 − y, z' = z. Check: the corner (0,0,0) goes to (2,2,0) and (2,2,2) goes to (0,0,2), so the cube occupies the same region.
If the axis were instead the z-axis itself (through the origin), the matrix would be diag(−1, −1, 1, 1).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Shear unit cube w.r.t. yz plane · Computer Graphics, chapter 4 · asked 4×
- Shear cube w.r.t. ZX plane, constant 3 · Computer Graphics, chapter 4 · asked 4×
- Rotate unit cube 90° about axis AB · Computer Graphics, chapter 4 · asked 2×
- Derive parallel projection matrix · Computer Graphics, chapter 4 · asked 2×
- Rotate line about Y-axis by 90° · Computer Graphics, chapter 4
- 3D rotation about axis (1,2,3)-(10,20,30) · Computer Graphics, chapter 4
- Degree of curve, tangential angle formula · Surveying II, chapter 6
- Cable on piers: tension, length, pier thrust (180 m) · Theory of Structures I, chapter 7 · asked 2×
- Five units of length, area, volume · Estimating and Costing, chapter 1
- Curvature where tangent is parallel to x-axis · Mathematics I, chapter 1