Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Geometric Transformations






Rotations, Reflections, Projections, and More

In R² and R³, linear transformations have concrete geometric meanings. Each has an explicit matrix encoding its action: rotations spin, reflections mirror, projections flatten, shears skew, and scalings stretch or compress. The determinant of the matrix classifies the transformation by how it affects area, volume, and orientation.



How to Read a Transformation Matrix

The geometric effect of a matrix AA is revealed by two pieces of information: what it does to the standard basis vectors (the columns) and what its determinant is.

Column 11 is the image of e1=(1,0)\mathbf{e}_1 = (1, 0) in R2\mathbb{R}^2 or (1,0,0)(1, 0, 0) in R3\mathbb{R}^3. Column 22 is the image of e2\mathbf{e}_2. The matrix maps the standard grid to the parallelogram (or parallelepiped) spanned by these column vectors.

The absolute value det(A)|\det(A)| measures how the transformation scales areas (in R2\mathbb{R}^2) or volumes (in R3\mathbb{R}^3). The sign of det(A)\det(A) indicates orientation: positive means the transformation preserves handedness, negative means it reverses it. An orthogonal matrix (det=±1\det = \pm 1) preserves all lengths and angles — it is a rigid motion.

Scaling

Uniform scaling multiplies every coordinate by the same factor: T(x)=cxT(\mathbf{x}) = c\mathbf{x}, with matrix cIcI. When c>1c > 1 the transformation enlarges, when 0<c<10 < c < 1 it shrinks, and when c<0c < 0 it reflects through the origin and scales.

Non-uniform scaling stretches each axis independently. In R2\mathbb{R}^2, T(x,y)=(c1x,c2y)T(x, y) = (c_1 x, c_2 y) has matrix diag(c1,c2)\text{diag}(c_1, c_2). The horizontal axis is scaled by c1c_1 and the vertical by c2c_2. A unit square maps to a rectangle with side lengths c1|c_1| and c2|c_2|.

The determinant is cnc^n for uniform scaling and c1c2c_1 c_2 (or c1c2c3c_1 c_2 c_3) for non-uniform. When any scaling factor is zero, the transformation collapses that axis entirely and the determinant is zero.

In R3\mathbb{R}^3, diag(c1,c2,c3)\text{diag}(c_1, c_2, c_3) scales each coordinate axis independently. The unit cube maps to a rectangular box with side lengths c1|c_1|, c2|c_2|, c3|c_3| and volume c1c2c3|c_1 c_2 c_3|.

Rotations in R²

Rotation by angle θ\theta counterclockwise about the origin has matrix

Rθ=(cosθsinθsinθcosθ)R_\theta = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}


The first column Rθe1=(cosθ,sinθ)R_\theta \mathbf{e}_1 = (\cos\theta, \sin\theta) is the image of (1,0)(1, 0) — the point on the unit circle at angle θ\theta. The second column Rθe2=(sinθ,cosθ)R_\theta \mathbf{e}_2 = (-\sin\theta, \cos\theta) is the image of (0,1)(0, 1) — the point at angle θ+90°\theta + 90°.

The determinant is cos2θ+sin2θ=1\cos^2\theta + \sin^2\theta = 1 for every θ\theta: rotations preserve areas and orientation. The matrix is orthogonal: RθTRθ=IR_\theta^T R_\theta = I, so lengths and angles are preserved. The inverse is Rθ1=Rθ=RθTR_\theta^{-1} = R_{-\theta} = R_\theta^T — rotating backward by the same angle.

Rotations compose by adding angles: RαRβ=Rα+βR_\alpha R_\beta = R_{\alpha + \beta}. This follows from the trigonometric addition formulas and corresponds to the fact that rotating by β\beta then by α\alpha is the same as rotating by α+β\alpha + \beta.

Common cases: R90°=(0110)R_{90°} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}, R180°=(1001)R_{180°} = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}, R45°=12(1111)R_{45°} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}.

Rotations in R³

In three dimensions, a rotation is specified by an axis and an angle. Rotation by θ\theta about the zz-axis leaves the zz-coordinate unchanged and rotates the xyxy-plane:

Rz(θ)=(cosθsinθ0sinθcosθ0001)R_z(\theta) = \begin{pmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{pmatrix}


Rotations about the xx-axis and yy-axis have the same 2×22 \times 2 rotation block embedded in different positions:

Rx(θ)=(1000cosθsinθ0sinθcosθ),Ry(θ)=(cosθ0sinθ010sinθ0cosθ)R_x(\theta) = \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta \\ 0 & \sin\theta & \cos\theta \end{pmatrix}, \quad R_y(\theta) = \begin{pmatrix} \cos\theta & 0 & \sin\theta \\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{pmatrix}


Every 3×33 \times 3 rotation matrix is orthogonal with determinant +1+1. The axis of rotation is the eigenvector with eigenvalue 11 — the direction that remains fixed. Any rotation in R3\mathbb{R}^3 can be decomposed into rotations about the coordinate axes (Euler angles), though the decomposition is not unique.

Reflections in R²

Reflection across the xx-axis flips the yy-coordinate: T(x,y)=(x,y)T(x, y) = (x, -y), with matrix (1001)\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}.

Reflection across the yy-axis flips the xx-coordinate: matrix (1001)\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}.

Reflection across the line y=xy = x swaps coordinates: matrix (0110)\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.

Reflection across an arbitrary line through the origin at angle α\alpha has matrix

Hα=(cos2αsin2αsin2αcos2α)H_\alpha = \begin{pmatrix} \cos 2\alpha & \sin 2\alpha \\ \sin 2\alpha & -\cos 2\alpha \end{pmatrix}


All reflection matrices share the same properties: the determinant is 1-1 (orientation-reversing, area-preserving), the matrix is orthogonal (lengths and angles preserved), and the matrix is involutory (H2=IH^2 = I) — reflecting twice returns every vector to its starting point. The eigenvalues are +1+1 (vectors on the mirror line) and 1-1 (vectors perpendicular to it).

Reflections in R³

Reflection across a coordinate plane negates the coordinate perpendicular to that plane. Reflection across the xyxy-plane: diag(1,1,1)\text{diag}(1, 1, -1). Across the xzxz-plane: diag(1,1,1)\text{diag}(1, -1, 1). Across the yzyz-plane: diag(1,1,1)\text{diag}(-1, 1, 1).

Reflection across an arbitrary plane through the origin with unit normal n\mathbf{n} is given by the Householder matrix:

H=I2nnTH = I - 2\mathbf{n}\mathbf{n}^T


This matrix subtracts twice the component of each vector in the direction of n\mathbf{n}, effectively mirroring across the plane perpendicular to n\mathbf{n}. Householder reflections are orthogonal, have determinant 1-1, and satisfy H2=IH^2 = I. They are the building blocks of the QR decomposition and are widely used in numerical algorithms.

Projections

Orthogonal projection onto a subspace collapses each vector onto its nearest point in the subspace, discarding the perpendicular component.

Projection onto the xx-axis in R2\mathbb{R}^2: T(x,y)=(x,0)T(x, y) = (x, 0), with matrix (1000)\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}.

Projection onto a line through the origin in direction u\mathbf{u}:

P=uuTuTuP = \frac{\mathbf{u}\mathbf{u}^T}{\mathbf{u}^T\mathbf{u}}


Projection onto a plane with unit normal n\mathbf{n} in R3\mathbb{R}^3:

P=InnTnTnP = I - \frac{\mathbf{n}\mathbf{n}^T}{\mathbf{n}^T\mathbf{n}}


All orthogonal projection matrices share the same algebraic signature: P2=PP^2 = P (idempotent — projecting twice is the same as projecting once), PT=PP^T = P (symmetric), eigenvalues are 00 and 11, and rank(P)=tr(P)\text{rank}(P) = \text{tr}(P). The determinant is 00 unless the projection is onto the full space — projections always collapse at least one dimension.

Shears

A shear displaces each point in proportion to its distance from a fixed line or plane. In R2\mathbb{R}^2, a horizontal shear shifts the xx-coordinate by kk times the yy-coordinate:

T(x,y)=(x+ky,  y),matrix (1k01)T(x, y) = (x + ky, \; y), \quad \text{matrix } \begin{pmatrix} 1 & k \\ 0 & 1 \end{pmatrix}


A vertical shear shifts the yy-coordinate by kk times the xx-coordinate:

T(x,y)=(x,  kx+y),matrix (10k1)T(x, y) = (x, \; kx + y), \quad \text{matrix } \begin{pmatrix} 1 & 0 \\ k & 1 \end{pmatrix}


Both are triangular matrices with determinant 11: shears are area-preserving and orientation-preserving. They are not orthogonal — angles are distorted. A square sheared horizontally becomes a parallelogram of the same area but with tilted sides.

In R3\mathbb{R}^3, there are six possible shear directions (each coordinate shifted by a multiple of each other coordinate). Each is represented by an identity matrix with one off-diagonal entry replaced by kk. Shears are fundamental building blocks — any invertible matrix with determinant 11 can be written as a product of shears.

Combining Transformations

Composing transformations corresponds to multiplying their matrices. A rotation followed by a scaling is SASA where SS is the scaling matrix and AA is the rotation matrix. The product is applied right-to-left: AA acts first, then SS.

Order matters. Rotating then shearing produces a different result from shearing then rotating: ShearRotationRotationShear\text{Shear} \cdot \text{Rotation} \neq \text{Rotation} \cdot \text{Shear} in general.

The singular value decomposition reveals the hidden geometric structure of any matrix: A=UΣVTA = U\Sigma V^T, where VTV^T is a rotation (or rotation-reflection), Σ\Sigma is a coordinate-axis scaling, and UU is another rotation (or rotation-reflection). Every linear transformation is a rotation, followed by a scaling along the coordinate axes, followed by another rotation. The singular values in Σ\Sigma measure the maximum stretching in each orthogonal direction.

This decomposition means no linear transformation is truly exotic — even the most complex-looking matrix is just three simple geometric operations composed together.

Determinant as Geometric Signature

The determinant classifies every linear transformation by its effect on size and orientation.

det(A)|\det(A)| is the factor by which the transformation scales areas (in R2\mathbb{R}^2) or volumes (in R3\mathbb{R}^3). A unit square maps to a parallelogram of area det(A)|\det(A)|. A unit cube maps to a parallelepiped of volume det(A)|\det(A)|.

det(A)>0\det(A) > 0: the transformation preserves orientation. Counterclockwise stays counterclockwise in R2\mathbb{R}^2; right-handed stays right-handed in R3\mathbb{R}^3. Rotations and shears fall in this category.

det(A)<0\det(A) < 0: the transformation reverses orientation. Counterclockwise becomes clockwise; right-handed becomes left-handed. Reflections are the canonical example.

det(A)=0\det(A) = 0: the transformation collapses at least one dimension. The image is a proper subspace — a line or point in R2\mathbb{R}^2, a plane, line, or point in R3\mathbb{R}^3. Projections onto proper subspaces and singular matrices fall here.

det(A)=1|\det(A)| = 1: the transformation preserves area or volume. Rotations (det=+1\det = +1) and reflections (det=1\det = -1) are the area-preserving and volume-preserving transformations. Shears also have det=1\det = 1, preserving area despite distorting angles.