---
title: "Rotation about a pivot point"
subject: "Computer Graphics"
chapter: 3
key: "semester_5/computer_graphics:rotation-about-pivot-point-derive"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/rotation-about-pivot-point-derive
site: BCT Engineering
---

# Rotation about a pivot point

Computer Graphics · Chapter 3: Two –Dimensional Transformations

- Asked in: 2070 Asar, 8 marks; 2078 Bhadra, 6 marks (asked 2 times)
- Video: [Computer Graphics:-Composite Transformations:-  General 2D Pivot Point Rotation](https://www.youtube.com/watch?v=TkFjM4u2FeM) — Priyanka Pujari
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/rotation-about-pivot-point-derive
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-3

## Question

Derive the 2D transformation matrix for rotating an object by angle θ about a pivot point (xr, yr) (composite matrix for rotation about an arbitrary point, clockwise).

## Short answer

Rotation about pivot (xr,yr) is M=T(xr,yr)*R(-theta)*T(-xr,-yr) with R(-theta)=[[cos theta, sin theta,0],[-sin theta, cos theta,0],[0,0,1]]. Thus x'=xr+(x-xr)cos theta+(y-yr)sin theta, y'=yr-(x-xr)sin theta+(y-yr)cos theta; for counter-clockwise replace theta by -theta.

## Answer

To rotate an object about a pivot point (xr, yr), the pivot is first moved to the origin, the object is rotated about the origin, and then the pivot is moved back. This is a composite transformation of three basic transformations.

#### Basic matrices (homogeneous, column vectors)
For **clockwise** rotation by θ, the angle is −θ in the standard (counter-clockwise positive) convention:

```text
Rotation about origin, clockwise θ:
   R(−θ) = |  cosθ  sinθ  0 |
           | −sinθ  cosθ  0 |
           |   0     0    1 |
Translation T(tx, ty) = | 1 0 tx |
                        | 0 1 ty |
                        | 0 0  1 |
```

#### Steps
1. Translate the pivot to the origin: T(−xr, −yr)
2. Rotate about the origin: R(−θ)
3. Translate back: T(xr, yr)

```text
M = T(xr, yr) · R(−θ) · T(−xr, −yr)

    | 1 0 xr |   |  cosθ  sinθ 0 |   | 1 0 −xr |
  = | 0 1 yr | · | −sinθ  cosθ 0 | · | 0 1 −yr |
    | 0 0  1 |   |   0     0   1 |   | 0 0   1  |
```

Multiplying the last two matrices first:

```text
 |  cosθ  sinθ  −xr·cosθ − yr·sinθ |
 | −sinθ  cosθ   xr·sinθ − yr·cosθ |
 |   0     0              1        |
```

Then adding the translation by (xr, yr):

```text
        |  cosθ   sinθ   xr(1 − cosθ) − yr·sinθ |
   M =  | −sinθ   cosθ   yr(1 − cosθ) + xr·sinθ |
        |   0      0               1            |
```

So a point P(x, y) goes to
x' = xr + (x − xr)cosθ + (y − yr)sinθ
y' = yr − (x − xr)sinθ + (y − yr)cosθ

**Check:** for (x, y) = (xr, yr): x' = xr, y' = yr, so the pivot does not move. For counter-clockwise rotation, replace θ by −θ (the sign of the sinθ terms changes).

## Check yourself

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

1. What is the correct order of operations for rotation about a pivot (xr, yr)?
   A. Rotate, translate pivot to origin, translate back
   B. Translate pivot to origin, rotate about origin, translate back
   C. Scale, rotate, translate
   D. Translate by (xr, yr), rotate, translate by (xr, yr) again
   Answer: B. The pivot is moved to the origin, the rotation is done, then the pivot is moved back. (Key point: Composite steps)

2. For clockwise rotation by theta, which matrix is used for the rotation step?
   A. Matrix with cosθ, -sinθ in the first row (counter-clockwise)
   B. Matrix with cosθ, sinθ in the first row and -sinθ, cosθ in the second
   C. Matrix with -cosθ on the diagonal
   D. Matrix with sinθ on the diagonal
   Answer: B. Clockwise by theta is R(-theta), which has cosθ, sinθ in the first row and -sinθ, cosθ in the second. (Key point: Clockwise rotation)

3. How is the composite matrix written with column vectors?
   A. M = T(-xr,-yr) · R(-θ) · T(xr,yr)
   B. M = R(-θ) · T(xr,yr) · T(-xr,-yr)
   C. M = T(xr,yr) · R(-θ) · T(-xr,-yr)
   D. M = T(xr,yr) · T(-xr,-yr) · R(-θ)
   Answer: C. With column vectors the first operation is the rightmost matrix, so T(-xr,-yr) is on the right. (Key point: Matrix product order)

4. How can you check the final matrix?
   A. The origin maps to itself
   B. The matrix has determinant 0
   C. All points move by (xr, yr)
   D. The pivot point maps to itself
   Answer: D. Substituting (xr, yr) gives x' = xr and y' = yr, so the pivot stays fixed. (Key point: Sanity check)

## Related in Computer Graphics

- [Composite rotation and shear in 2D](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acomposite-rotation-and-shear-2d) — Computer Graphics, chapter 3
- [Scaling about arbitrary fixed point](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Ascaling-about-fixed-point) — Computer Graphics, chapter 3
- [3D rotation matrices (clockwise)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotation-matrices-xyz-clockwise) — Computer Graphics, chapter 4
- [3D scaling about arbitrary point](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Ascale-3d-arbitrary-point) — 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 about axis (1,2,3)-(10,20,30)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotate-3d-axis-1-2-3) — Computer Graphics, chapter 4

## Related in other subjects

- [Bar stiffness matrix and 2D truss element](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Abar-stiffness-truss-rotation) — Computational Techniques in Civil Engineering, chapter 4
- [Composite curve by deflection angle method](https://www.bctengineer.com/question.md?key=semester_4%2Fsurveying_ii%3Acomposite-curve-deflection-angle-method) — Surveying II, chapter 6, asked 5×
- [Derive beam element stiffness matrix](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Abeam-element-stiffness-derivation) — Finite Element Method, chapter 3
- [4-point DFT by linear transformation](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Adft-linear-transformation) — Signals and Systems, chapter 3
