Rotation turns a plane around a fixed point. In the standard 2D form, that point is the origin: every input coordinate (xi, yi) becomes a new coordinate (xr, yr) at an angle t measured in radians. It is one of the common transformations used in graphics and design. section 4.1.3
Figure 4.5 Three examples of standard square rotations. All rotations go around the zero point (0, 0).
Square positions make the central rule visible: the shape turns, while the zero point (0, 0) stays fixed. section 4.1.3
Use the coordinate formulas xr = cos(t)·xi + sin(t)·yi and yr = -sin(t)·xi + cos(t)·yi. The sine and cosine terms determine how much each original coordinate contributes after the turn. Getting those terms swapped is an easy mistake, so relate them to the geometry rather than memorizing an isolated pattern. section 4.1.3
A practical way to reason about the formula is to check its ingredients:
- The angle t is in radians. section 4.1.3
- Sine is continuous, periodic with period 2π, and odd: sin(-x) = -sin(x). section 4.1.3
- For small x, sin(x) is approximately x; the stated example at x = 0.244 has about 1% relative difference. section 4.1.3
- A rotation about a shape's center can be expressed as a composition of transformations rather than as a separate special case. section 4.1.3
Homogeneous coordinates turn rotation, translation, scaling, shear, and perspective into instances of matrix multiplication. This is useful when several operations must run together: multiply their matrices into one composite transformation, then apply that one matrix to each point. The same approach extends to 3D, where homogeneous points and vectors have four components and transformations use 4 × 4 matrices. section 4.3.2 section 4.7
Rotate, translate, then translate back
A center rotation can be assembled from three matrices: translate the intended center to the origin, apply a rotation matrix, then translate back. For example, matrices a1, a2, and a3 are multiplied as c = a3*a2*a1. Applying c to the four corners of a rectangle produces its transformed corners with one matrix-vector multiplication per point. section 4.3.2
Matrix form also makes reversal systematic. Projective transformations compose into another single projective transformation and have inverse operations, so an inverse transformation can map transformed points back. In homogeneous space, multiplying a matrix or point coordinates by a nonzero scalar can represent the same point or transformation mathematically. section 4.3.2 section 4.7
Choose the direct formula when rotating an individual 2D point is all that is needed. Choose homogeneous transformation matrices when rotation must share an implementation with translation, scaling, or other composable operations; that avoids maintaining separate routines for every partial case. section 4.1.3 section 4.3.2



