The following describes the 2d transformation of a point on a plane
P = ( x , y ) -> P' = ( x' , y' )
x' = x + Tx
y' = y + Ty
x' = Sx x
y' = Sy y
If Sx and Sy are not equal this results in
a stretching along the axis of the larger scale factor.
To scale about a particular point, first translate to the origin,
scale, and translate back to the original position. For example, to
scale about the point (x0,y0)
x' = x0 + Sx ( x - x0 )
y' = y0 + Sy ( y - y0 )
x' = x cos(A) + y sin(A)
y' = y cos(A) - x sin(A)
To rotate about a particular point apply the same technique as described for scaling, translate the coordinate system to the origin, rotate, and the translate back.
x' = x
y' = - y
Reflection about the y axis
x' = - x
y' = y
Reflections about an arbitrary line involve possibly a translation so that a point on the line passes through the origin, a rotation of the line to align it with one of the axis, a reflection, inverse rotation and inverse translation.
x' = SHx x
y' = y
A shear by SHy in the y axis is accomplished with
x' = x
y' = SHy y