#790 – How a Rotation Transform Works
April 3, 2013 2 Comments
A 2D rotation transform in WPF is accomplished by using a transformation matrix. The transformation matrix is multiplied by another matrix representing a single 2D point to be transformed. The resulting matrix describes the transformed point. When rotating a user interface element, this transformation is done individually on each point to generate the set of points representing the transformed element.
The transformation operation for rotation looks like:
Where ϴ represents the Angle property of the ScaleTransform, indicating the number of degrees to rotate the point in a clockwise direction.
This leads to the equations: