---
title: "3D rotation about axis (1,2,3)-(10,20,30)"
subject: "Computer Graphics"
chapter: 4
key: "semester_5/computer_graphics:rotate-3d-axis-1-2-3"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/rotate-3d-axis-1-2-3
site: BCT Engineering
---

# 3D rotation about axis (1,2,3)-(10,20,30)

Computer Graphics · Chapter 4: Three-Dimensional Graphics

- Asked in: 2076 Asoj, 10 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/rotate-3d-axis-1-2-3
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-4

## Question

List down the steps for rotating a 3D object by 90° in counter clockwise direction about an axis joining end points (1,2,3) and (10,20,30). Also derive the final transformation matrix.

## Short answer

Translate by (−1,−2,−3). Rotate about x by α (cosα=0.8321, sinα=0.5547) to lay axis in xz-plane. Rotate about y by β (cosβ=0.9636, sinβ=0.2673) to align with z. Rotate 90° about z, then reverse Ry and Rx, translate back. Final matrix: [0.0714 −0.6589 0.7488 0; 0.9446 0.2857 0.1613 0; −0.3202 0.6958 0.6429 0; 0 0 0 1].

## Answer

Axis through P1(1,2,3) and P2(10,20,30). Rotation θ = 90° counter-clockwise.

#### Steps
1. Translate P1 to the origin: T(−1, −2, −3).
2. Rotate about x by α to put the axis in the xz plane.
3. Rotate about y by β to put the axis on the z-axis.
4. Rotate about z by 90°.
5. Apply Ry(−β), then Rx(−α).
6. Translate back with T(1, 2, 3).

M = T(P1)·Rx(−α)·Ry(−β)·Rz(90°)·Ry(β)·Rx(α)·T(−P1)

#### Numbers
V = P2 − P1 = (9, 18, 27), L = √(81 + 324 + 729) = √1134 = 33.675

Unit vector (a, b, c) = (0.2673, 0.5345, 0.8018) (this equals (1, 2, 3)/√14)

d = √(b² + c²) = √(0.2857 + 0.6429) = 0.9636

cosα = c/d = 0.8321, sinα = b/d = 0.5547; cosβ = d = 0.9636, sinβ = a = 0.2673

```text
Rx(α) = | 1  0       0      0 |     Ry(β) = | 0.9636 0 -0.2673 0 |
        | 0  0.8321 -0.5547 0 |             | 0      1  0      0 |
        | 0  0.5547  0.8321 0 |             | 0.2673 0  0.9636 0 |
        | 0  0       0      1 |             | 0      0  0      1 |

Rz(90°) = | 0 -1 0 0 |
          | 1  0 0 0 |
          | 0  0 1 0 |
          | 0  0 0 1 |
```

#### Final matrix
The axis line passes through the origin (P1 = (1,2,3) and P2 = 10·P1), so the translation part of M is zero. Multiplying all matrices gives

```text
M = |  0.0714 -0.6589  0.7488  0 |
    |  0.9446  0.2857  0.1613  0 |
    | -0.3202  0.6958  0.6429  0 |
    |  0       0       0       1 |
```

Exact entries: 1/14, 2/7 and 9/14 on the diagonal (0.0714, 0.2857, 0.6429). The matrix agrees with the Rodrigues formula R = I + sinθ·K + (1 − cosθ)·K² for u = (1,2,3)/√14 (K is the cross-product matrix of u). Applying M to any point on the axis, e.g. (1,2,3), leaves it unchanged.

**Answer:** M above.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why is the translation part of the final matrix zero?
   A. Because the angle is 90°
   B. The axis line passes through the origin (P2 = 10·P1)
   C. Because rotation matrices never have translation
   D. Because the axis is the z-axis
   Answer: B. The line through (1,2,3) and (10,20,30) passes through the origin, so T(-P1) and T(P1) cancel. (Key point: Translation part)

2. The unit vector of the axis is:
   A. (1,2,3)/sqrt(6)
   B. (9,18,27)/6
   C. (1,1,1)/sqrt(3)
   D. (1,2,3)/sqrt(14)
   Answer: D. (9,18,27) = 9(1,2,3) and |(1,2,3)| = sqrt(14). (Key point: Unit vector)

3. cosα and sinα for the first rotation are:
   A. cosα = c/d = 0.8321, sinα = b/d = 0.5547
   B. cosα = 0.5547, sinα = 0.8321
   C. cosα = d, sinα = a
   D. cosα = a, sinα = b
   Answer: A. c = 0.8018, b = 0.5345, d = 0.9636. (Key point: Angle alpha)

4. Which result must hold for the final matrix M?
   A. Every point is unchanged
   B. The axis maps to the x-axis
   C. A point on the axis, like (1,2,3), is unchanged
   D. The determinant is 0
   Answer: C. The axis is the fixed line of the rotation. (Key point: Check)

## Related in Computer Graphics

- [3D rotation matrices (clockwise)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotation-matrices-xyz-clockwise) — Computer Graphics, chapter 4
- [3D rotation about arbitrary axis](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotate-3d-arbitrary-axis-steps) — Computer Graphics, chapter 4, asked 2×
- [3D rotation steps and perspective projection](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotate-3d-arbitrary-axis-perspective) — Computer Graphics, chapter 4
- [Rotate line about Y-axis by 90°](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotate-line-y-axis-90) — Computer Graphics, chapter 4
- [Midpoint circle: r=30, centre (10,20)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acircle-r30-center-10-20-octant) — Computer Graphics, chapter 2, asked 2×
- [Rotation about a pivot point](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotation-about-pivot-point-derive) — Computer Graphics, chapter 3, asked 2×

## Related in other subjects

- [Stiffness matrix: final end moments, 2.5EI frame](https://www.bctengineer.com/question.md?key=semester_5%2Ftheory_of_structures_ii%3Astiffness-frame-20knm-8knm-15kn) — Theory of Structures II, chapter 3
- [AVL tree for 10, 20, 30, 35, 50, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aavl-build-10-20-30-35) — Data Structure and Algorithm, chapter 6
- [Frame rotation and vertical deflection at free end](https://www.bctengineer.com/question.md?key=semester_4%2Ftheory_of_structures_i%3Aframe-rotation-vertical-free-end-2073m) — Theory of Structures I, chapter 3
- [Fixed beam: end moments from support rotation or settlement](https://www.bctengineer.com/question.md?key=semester_5%2Ftheory_of_structures_ii%3Afixed-beam-end-moments-rotation-settlement) — Theory of Structures II, chapter 3, asked 4×
