---
title: "Rotate unit cube 90° about axis AB"
subject: "Computer Graphics"
chapter: 4
key: "semester_5/computer_graphics:cube-rotate-90-axis-a-b"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/cube-rotate-90-axis-a-b
site: BCT Engineering
---

# Rotate unit cube 90° about axis AB

Computer Graphics · Chapter 4: Three-Dimensional Graphics

- Asked in: 2068 Chaitra, 8 marks; 2073 Chaitra, 7 marks (asked 2 times)
- Video: [Transformation in 3-D with numericals](https://www.youtube.com/watch?v=0ebVXplaJFc) — Vinay Mishra
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/cube-rotate-90-axis-a-b
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-4

## Question

Find the new coordinates of a unit cube 90° rotated about an axis defined by its endpoints A(2,1,0) and B(3,3,1).

## Short answer

Translate by (-2,-1,0), align axis to z via Rx(α) and Ry(β) with unit vector (0.408,0.816,0.408), rotate 90° about z, then reverse. New corners: (1.74,-1.15,0.56), (2.73,-1.22,0.72), (1.67,-0.48,1.30), (2.65,-0.56,1.47), (1.91,-0.41,-0.09), (2.89,-0.48,0.08), (1.83,0.26,0.65), (2.82,0.18,0.82).

## Answer

**Assumption:** the unit cube has corners from (0,0,0) to (1,1,1). The rotation is 90° counter-clockwise when looking from B towards A.

**Step 1: axis data**

AB = B − A = (1, 2, 1), L = √6 = 2.4495

Unit vector (a, b, c) = (0.4082, 0.8165, 0.4082), d = √(b² + c²) = √(5/6) = 0.9129

cosα = c/d = 0.4472, sinα = b/d = 0.8944; cosβ = d = 0.9129, sinβ = a = 0.4082

**Step 2: matrices**

```text
T(-A) = translate by (-2,-1, 0)

Rx(α) = | 1  0       0      0 |
        | 0  0.4472 -0.8944 0 |
        | 0  0.8944  0.4472 0 |
        | 0  0       0      1 |

Ry(β) = | 0.9129 0 -0.4082 0 |
        | 0      1  0      0 |
        | 0.4082 0  0.9129 0 |
        | 0      0  0      1 |

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

**Step 3: composite** M = T(A)·Rx(−α)·Ry(−β)·Rz(90°)·Ry(β)·Rx(α)·T(−A)

```text
M = |  0.1667 -0.0749  0.9832  1.7416 |
    |  0.7416  0.6667 -0.0749 -1.1498 |
    | -0.6498  0.7416  0.1667  0.5581 |
    |  0       0       0       1      |
```

**Step 4: new corners** (P' = M·P)

| Original | New |
|---|---|
| (0,0,0) | (1.742, −1.150, 0.558) |
| (0,0,1) | (2.725, −1.225, 0.725) |
| (0,1,0) | (1.667, −0.483, 1.300) |
| (0,1,1) | (2.650, −0.558, 1.466) |
| (1,0,0) | (1.908, −0.408, −0.092) |
| (1,0,1) | (2.891, −0.483, 0.075) |
| (1,1,0) | (1.833, 0.258, 0.650) |
| (1,1,1) | (2.816, 0.184, 0.816) |

Check: the rotation keeps every edge length equal to 1 and every point of the line AB fixed.

**Answer:** the eight transformed corners are listed in the table above.

## Check yourself

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

1. For A(2,1,0), B(3,3,1), the axis vector and length are:
   A. (1,2,1), length sqrt(6)
   B. (5,4,1), length sqrt(42)
   C. (1,2,1), length 4
   D. (1,1,1), length 3
   Answer: A. B - A = (1,2,1) and L = sqrt(1+4+1) = sqrt(6) = 2.4495. (Key point: Axis vector)

2. Which gives cosα and sinα for the first rotation?
   A. cosα = a/d, sinα = b/d
   B. cosα = d, sinα = a
   C. cosα = c/d = 0.4472, sinα = b/d = 0.8944
   D. cosα = b/d = 0.8944, sinα = c/d = 0.4472
   Answer: C. 0.4082/0.9129 = 0.4472 and 0.8165/0.9129 = 0.8944. (Key point: Angles)

3. Which check confirms the rotated cube is correct?
   A. Every corner stays at its original position
   B. Every corner moves by exactly 90 units
   C. The cube becomes larger by sqrt(6)
   D. Edge lengths stay 1 and points on line AB stay fixed
   Answer: D. A rotation is rigid and leaves its axis points unchanged. (Key point: Check of result)

## Related in Computer Graphics

- [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
- [Shear unit cube w.r.t. yz plane](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acube-shear-yz-constant-2) — Computer Graphics, chapter 4, asked 4×
- [Rotate object about axis y=4](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotate-object-about-y-4) — Computer Graphics, chapter 4
- [Cube spinning 180° about z-parallel axis](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acube-spin-180-z-axis) — Computer Graphics, chapter 4
- [Shear cube w.r.t. ZX plane, constant 3](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acube-shear-zx-constant-3) — Computer Graphics, chapter 4, asked 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×

## Related in other subjects

- [Area by total coordinates and DMD (AB 90.29)](https://www.bctengineer.com/question.md?key=semester_3%2Fsurveying_i%3Admd-and-coordinates-ab-90-29) — Surveying I, chapter 9
- [RL of B for bridge axis AB (58.60 m)](https://www.bctengineer.com/question.md?key=semester_3%2Fsurveying_i%3Abridge-axis-ab-58-60m-rl-b) — Surveying I, chapter 5
- [Area by coordinates and DMD (AB -370)](https://www.bctengineer.com/question.md?key=semester_3%2Fsurveying_i%3Aarea-coordinate-and-dmd-minus-370) — Surveying I, chapter 9, asked 4×
- [Rod with spring released, 90 degree rotation](https://www.bctengineer.com/question.md?key=semester_3%2Fapplied_mechanics_dynamics%3Arod-spring-4kg-pivot-b) — Applied Mechanics (Dynamics), chapter 6, asked 2×
