What Is A 3D Transformation Matrix? (Linear Algebra)

A 3D transformation matrix is a grid of numbers that changes a vector’s position or direction according to a defined rule. A 3 × 3 matrix handles linear operations such as rotation, scaling, reflection, and shear around the origin. To include translation, use a 4 × 4 matrix with homogeneous coordinates. With column vectors, multiply the vector on the right.

“Linear algebra is the study of linear maps,” a useful framing associated with mathematician Sheldon Axler’s textbook Linear Algebra Done Right. A transformation matrix makes one of those maps concrete: it tells you how an input vector becomes an output vector. Once you know the conventions, you can read the matrix, apply it, and check whether the result makes sense.

What Is A 3D Transformation Matrix? (Linear Algebra)

I’ll use column vectors throughout, so the rule is (\mathbf v’=M\mathbf v). This choice matters: matrix order changes the result, and other fields sometimes use row vectors instead. Keep the convention visible whenever you calculate.

3D Transformation Matrices: Definition, Conventions & Applications

A 3D transformation matrix is a numerical rule for mapping points or vectors in three-dimensional space to new ones. For ordinary linear transformations, it is a 3 × 3 matrix acting on ((x,y,z)^T). Its columns show where the three unit-axis vectors end up, making the matrix’s geometric effect easier to interpret.

What does a 3 × 3 matrix do?

A 3 × 3 matrix has three rows and three columns. Multiplying it by a vector produces another vector with three components:

[ \begin{bmatrix}x’\y’\z’\end{bmatrix} = \begin{bmatrix}a&b&c\d&e&f\g&h&i\end{bmatrix} \begin{bmatrix}x\y\z\end{bmatrix} = \begin{bmatrix}ax+by+cz\dx+ey+fz\gx+hy+iz\end{bmatrix}. ]

Each output coordinate is a weighted sum of the input coordinates. For instance, the first row determines (x’). A matrix transforms the origin to itself, and it respects vector addition and scaling. These properties define a linear transformation.

A simple way to understand the columns is to apply the matrix to the unit vectors (\mathbf e_x=(1,0,0)^T), (\mathbf e_y=(0,1,0)^T), and (\mathbf e_z=(0,0,1)^T). Each result is the corresponding column of (M). Together, those columns show how the coordinate axes are transformed.

Which operations can it represent?

A 3 × 3 matrix can represent rotation, scaling, reflection, shear, and combinations of these operations, as long as the transformation is linear. Rotation changes direction while preserving lengths and angles. Scaling changes length; reflection flips orientation; and shear slants shapes by shifting coordinates in proportion to other coordinates.

For example, rotation around the (z)-axis by angle (\theta) is

[ R_z(\theta)= \begin{bmatrix} \cos\theta&-\sin\theta&0\ \sin\theta&\cos\theta&0\ 0&0&1 \end{bmatrix}. ]

The (z)-coordinate stays fixed while (x) and (y) rotate in the (xy)-plane. Angles may be measured in degrees or radians, depending on the calculation or software. Check which convention your tool expects.

Matrix Types, Homogeneous Coordinates & Core Requirements

A 3 × 3 matrix handles linear transformations about the origin, but it cannot represent a translation by itself. A 4 × 4 homogeneous-coordinate matrix extends the vector with a fourth component, usually (1) for a point. This lets one matrix format combine rotation, scaling, and translation.

How do common transformation matrices compare?

These examples use column vectors. In the table, (s_x,s_y,s_z) are scale factors, and (t_x,t_y,t_z) are translation distances.

Transformation Matrix or rule What it does
Scaling (\begin{bmatrix}s_x&0&0\0&s_y&0\0&0&s_z\end{bmatrix}) Stretches or shrinks each axis
Reflection across the (xy)-plane (\begin{bmatrix}1&0&0\0&1&0\0&0&-1\end{bmatrix}) Reverses the sign of (z)
Shear in (x) by (y) (\begin{bmatrix}1&k&0\0&1&0\0&0&1\end{bmatrix}) Changes (x) by (k y)
Translation Use a 4 × 4 matrix Shifts points by ((t_x,t_y,t_z))

For scaling, a factor of (2) doubles a coordinate, while a factor of (0.5) halves it. A negative factor also reverses direction along that axis. In the shear example, (x’=x+ky), so points with different (y)-values shift by different amounts.

Why does translation need homogeneous coordinates?

Translation is not linear in ordinary 3D space because it moves the origin. A linear transformation must map the zero vector to zero, but translation sends ((0,0,0)) to ((t_x,t_y,t_z)). Homogeneous coordinates add a fourth component so translation can be included in matrix multiplication.

Represent a point as (\tilde{\mathbf v}=(x,y,z,1)^T). Then translation uses

[ T= \begin{bmatrix} 1&0&0&t_x\ 0&1&0&t_y\ 0&0&1&t_z\ 0&0&0&1 \end{bmatrix}. ]

Multiplication gives ((x+t_x,y+t_y,z+t_z,1)^T). The final coordinate is (1), so the result still represents a point. In computer graphics and geometry, 4 × 4 homogeneous matrices provide a consistent way to combine translations with other transformations.

What do determinant and inverse tell you?

The determinant is a number that measures how a 3 × 3 linear transformation changes signed volume. If (\det(M)\ne0), the transformation is invertible: you can recover the original vector from the transformed one. If (\det(M)=0), at least one dimension has collapsed, so distinct inputs may map to the same output.

A rotation matrix has determinant (1), so it preserves orientation and volume. A reflection has determinant (-1), indicating a flip in orientation. A zero scale factor makes the determinant zero and collapses space along that axis. These checks can help catch errors, but they do not replace checking the actual coordinates.

Worked Examples, Common Errors & Study Strategies

A worked example connects the symbols to a result you can verify. Start by writing the vector and matrix in the same convention, then multiply rows by the vector’s components. Afterward, test whether the output matches the intended geometry, such as a preserved length for a rotation.

How do you apply a rotation matrix?

Take a 90-degree rotation around the (z)-axis and the vector (\mathbf v=(1,0,2)^T). Since (\cos 90^\circ=0) and (\sin 90^\circ=1),

[ R_z(90^\circ)= \begin{bmatrix}0&-1&0\1&0&0\0&0&1\end{bmatrix}. ]

Multiplying gives

[ R_z\mathbf v= \begin{bmatrix}0&-1&0\1&0&0\0&0&1\end{bmatrix} \begin{bmatrix}1\0\2\end{bmatrix} = \begin{bmatrix}0\1\2\end{bmatrix}. ]

The point’s (z)-coordinate remains (2), while its (xy)-coordinates rotate from ((1,0)) to ((0,1)). Its length remains (\sqrt{1^2+0^2+2^2}=\sqrt5), which is a useful check.

How does the order of transformations work?

Matrix multiplication is generally not commutative: (AB) may differ from (BA). With column vectors, (M_2M_1\mathbf v) applies (M_1) first and (M_2) second. Read a product from right to left to identify the actual sequence.

For a simple example, start with ((1,0,0)^T). Rotate it 90 degrees around (z), then translate by ((1,0,0)). The rotation gives ((0,1,0)^T), and the translation gives ((1,1,0)^T). Reversing the order translates first and then rotates, producing ((0,2,0)^T). The outcomes differ.

In homogeneous coordinates, the first sequence is written (T R\tilde{\mathbf v}), because the rotation matrix (R) is applied first. Label each matrix with its intended operation before multiplying; this small habit prevents order mistakes.

What errors should you check first?

When I explain transformation calculations, I begin by checking the vector convention. A result can look reasonable even when the multiplication order is wrong, so I ask learners to state whether they use row or column vectors before calculating. Then we test a simple vector, such as an axis unit vector, to see whether the matrix behaves as intended.

  • Check dimensions: a 3 × 3 matrix multiplies a 3-component column vector; a 4 × 4 homogeneous matrix multiplies a 4-component vector.
  • Confirm angle units: degrees and radians are not interchangeable.
  • State the axis and direction of rotation, along with the coordinate convention.
  • For a rotation, check that lengths are preserved and the determinant is (1).
  • For invertibility, check whether the determinant is zero.
  • For a product of matrices, apply the rightmost matrix first.

A reliable study sequence is to review vectors and matrix-vector multiplication, learn the operation matrices, then practice composing them. Add homogeneous coordinates after the distinction between linear transformations and translations is clear.

Applications in Computer Graphics, Robotics & Further Study

Transformation matrices are used wherever a system must describe how coordinates change between positions, orientations, or frames. In graphics, they can position and rotate models. In robotics, they can relate coordinate frames attached to a robot part and its surroundings. The mathematics is the same, though applications may use different conventions.

What does a transformation chain look like in practice?

Consider a computer-graphics model whose local point is (\mathbf p). A rotation changes its orientation, and a translation places it in a scene. Using column vectors and homogeneous coordinates, the combined operation can be written (\tilde{\mathbf p}’=T R\tilde{\mathbf p}). The order means rotate the local point first, then translate it.

A robotics example uses the same idea: a point’s coordinates may be described relative to one component, then transformed into a larger reference frame. Each matrix must match the coordinate frames and conventions in use. A matrix is not automatically meaningful without knowing what its input and output coordinates represent.

Check Expected result or question Why it helps
Matrix size 3 × 3 for a linear map; 4 × 4 for homogeneous coordinates Confirms compatible dimensions
Rotation test Lengths remain unchanged Detects many rotation errors
Determinant Nonzero means invertible Shows whether information is lost
Product order Rightmost operation happens first Prevents sequence reversal
Coordinate meaning What frame does the input use, and what frame does output use? Makes the transformation interpretable

For further study, practice deriving the rotation matrices around the (x)- and (y)-axes, multiplying two transformations, and converting a translation into homogeneous form. Then verify results with a test vector rather than relying only on visual intuition.

The central distinction is simple: 3 × 3 matrices represent linear transformations in 3D, while 4 × 4 homogeneous matrices can also represent translations. State the vector convention, multiply in the correct order, and test the result against the geometry you expect.

Frequently asked questions

Is a 3D transformation matrix always 3 × 3?
No. A 3 × 3 matrix represents a linear transformation in ordinary 3D coordinates. A 4 × 4 homogeneous-coordinate matrix is commonly used when translation must be included.

Can a 3 × 3 matrix represent translation?
Not as a linear transformation in ordinary 3D space. Translation moves the origin, so it is commonly represented with a 4 × 4 homogeneous-coordinate matrix.

What does a transformation matrix do to a vector?
It multiplies the vector by a defined numerical rule to produce a new vector. For column vectors, the standard form is (\mathbf v’=M\mathbf v).

Why does matrix order matter?
The order determines the sequence of operations. With column vectors, (M_2M_1\mathbf v) applies (M_1) first, then (M_2).

How can I tell whether a 3 × 3 matrix is invertible?
Calculate its determinant. The matrix is invertible exactly when its determinant is nonzero.

What does a determinant of zero mean geometrically?
The transformation collapses at least one dimension. Different input vectors may map to the same output, so the original information cannot always be recovered.

Does a rotation matrix change vector length?
A pure rotation preserves vector lengths and angles. For a standard 3D rotation matrix, the determinant is (1).

What does a shear matrix do?
A shear shifts one coordinate in proportion to another. For example, (x’=x+ky) shifts (x) according to the value of (y).

What is a homogeneous coordinate?
It is an added coordinate used to represent points in a form that allows translation to be included in matrix multiplication. A 3D point is commonly written ((x,y,z,1)^T).

Should I use degrees or radians for rotation angles?
Use the angle unit expected by your calculation or software. State the unit explicitly, because treating degrees as radians changes the result.

(This article was written by one of our staff writers, Nathan Sterling. Visit our Meet the Team page.)

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *