Graphics / Reference / Transforming about an arbitrary point
Transforming about an arbitrary point
To scale or rotate about a point other than the origin, move that pivot to the origin, apply the origin-centred transformation, then move the pivot back.
To scale by factor m about arbitrary point (xo,yo), use three transformations in this applied order:
1. translate (xo,yo) to the origin 2. scale about the origin 3. translate back to (xo,yo)
With column vectors:
T1 = [1,0,-xo;0,1,-yo;0,0,1]
T2 = [1,0,xo;0,1,yo;0,0,1]
If S is the scale matrix, then:
p' = T1*p
p'' = S*p' = S*T1*p
p''' = T2*p'' = T2*S*T1*p
So the composite scale-about-pivot matrix is T2*S*T1.
Rotation about an arbitrary point uses the same structure with a rotation matrix R in place of S:
T2*R*T1
The standard pivot diagram shows a star scaling around its own centre while the global origin remains elsewhere.
A related composition example transforms a diamond near the origin into an axis-aligned square centred at (-2,2): rotate 45 degrees, scale by sqrt(2), then translate by (-2,2), giving T*S*R.
Builds on
Read
- Read the chapter: Transforming about an arbitrary point