Rotation about any Point:
which again provides
x′ = x * Sx
y′ = y * Sy
Rotation is shown by R (q) :
which gives
x′ = x cos φ - y sin φ
y′ = y cos φ + x sin φ
So this is clear that to rotate or scale an object about any point P0 (x0 y0), the following have to be done
1. Translate P0 to origin : T (- x0, - y0)
2. Rotate R (q)
3. Translate back to P0; T (+ x0, + y0)
So (x′ y′) = (x y) * M, where M = T ((- x0, - y0) * R (q) * T(+ x0, + y0).
Figure: Rotation about any Point P0 (x0, y0)