In our last lesson, we established the fundamental algebraic rules for translation, rotation, and scaling. We saw how to apply these formulas to transform points and discovered that the sequence of these operations is critically important. While functional, applying these rules one by one is inefficient for the complex geometric manipulations needed in parametric design.
Today, we will elevate our understanding by representing these transformations as unified mathematical objects: matrices. This lesson will bridge the gap between the separate algebraic formulas you now know and the powerful, efficient engine that drives transformations in software like Rhino and Grasshopper. Our goal is to understand how each geometric operation can be encoded into a matrix and why this representation is so fundamental to computer graphics and architecture.
The Essence of a Transformation Matrix
At its heart, a matrix is more than just a grid of numbers; it's a way to describe a transformation of space. The best way to build this intuition is to see it in action. A linear transformation is a special kind of transformation that has two key visual properties: all lines remain lines (they don't curve), and the origin stays fixed.
The following video from the channel 3Blue1Brown provides one of the clearest explanations of this concept. As you watch, focus on the core idea that a complex transformation of the entire 2D plane can be understood by observing what happens to just two special vectors.
Linear transformations and matrices | Chapter 3, Essence of linear algebra
This video, "Linear transformations and matrices," masterfully illustrates the intuition behind matrix transformations.
Please watch the first two segments. First, focus on the visual definition of a linear transformation as one that keeps grid lines parallel and evenly spaced. Next, pay close attention to the crucial insight explained from 03:48 to 05:37. The key takeaway is that any 2D linear transformation is completely determined by where the basis vectors \hat{i} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} and \hat{j} = \begin{pmatrix} 0 \\ 1 \end{pmatrix} land.
As the video explains, if we know that the basis vector lands at coordinates and lands at , we can construct a matrix that represents this transformation:
The first column is the destination of , and the second column is the destination of . Applying this transformation to any vector is then performed by matrix-vector multiplication:
This operation is equivalent to the logic from the video: the new vector's position is .
From Basis Vectors to Transformation Matrices
With this core concept, we can now construct the matrices for the transformations we studied in the previous lesson.
Rotation
Let's find the matrix for a counter-clockwise rotation by an angle . We simply need to find where and land.
-
Transform : The vector is a unit vector along the x-axis. Rotating it by lands it at the point . This gives us our first column: .
-
Transform : The vector is a unit vector along the y-axis. Rotating it by lands it at . Using trigonometric identities, this simplifies to . This is our second column: .
Putting them together, the rotation matrix is:
Notice that if you multiply this matrix by a vector , you get , which exactly matches the algebraic formulas from our last lesson.
Scaling
Scaling is even more straightforward. To scale by factors and :
- Transform : The vector is scaled along the x-axis to become .
- Transform : The vector is scaled along the y-axis to become .
The scaling matrix is therefore:
The Problem with Translation
There's one crucial transformation missing: translation. If we try to apply the same logic, we hit a snag. A translation shifts every point, including the origin. However, any transformation represented by a 2x2 matrix must leave the origin unchanged, since for any matrix .
This limitation means we cannot express translation with a 2x2 matrix. To create a unified system for all transformations, we need a clever mathematical device used throughout computer graphics: homogeneous coordinates.
The idea is to represent 2D points in a 3D space. We take our 2D point and give it a third coordinate, which we set to 1, making it the 3D vector . This seemingly strange step allows us to perform translation via matrix multiplication.
The following video and text explain this concept beautifully.
Affine transformations in 5 minutes
The channel "Graphics in 5 Minutes" has a video that perfectly summarizes why translation requires a different approach and how homogeneous coordinates provide the solution.
Watch the segment from 03:38 to 05:18, which explains the issue with translating the origin and introduces the 3x3 matrix solution.
To understand this more formally, let's explore a section from a linear algebra text that discusses this exact technique in the context of computer animation.
2.6 The geometry of matrix transformations
This text from "Understanding Linear Algebra" explains the motivation and mechanics of homogeneous coordinates.
Read the subsection titled "Matrix transformations and computer animation." Start from the paragraph that introduces translations. The text explains why a matrix transformation cannot move the origin and then introduces homogeneous coordinates as the solution, embedding 2D space within \mathbb{R}^3.
The Unified 3x3 Transformation Matrices
By using homogeneous coordinates, we can now define all our basic transformations with 3x3 matrices. The original 2x2 matrix is placed in the upper-left, and the translation components occupy the third column.
Translation:
When we multiply this by our homogeneous point:
The resulting vector contains the correctly translated coordinates in its first two components.
Rotation:
Scaling:
This image provides an excellent visual summary of the main 2D transformations and their corresponding 3x3 matrices.

A visual catalog of common 2D transformations applied to the letter 'F', each with its associated 3x3 homogeneous transformation matrix. Note that W and H in the 'Scale' matrix correspond to and , respectively.
You can now see how each of the fundamental geometric operations can be encoded in this unified matrix format.
Conclusion
In this lesson, we made a significant leap from individual algebraic formulas to a powerful, unified system. We've seen how matrices act as operators that transform geometric space and how to construct them by understanding their effect on basis vectors.
Here are the key takeaways:
- A linear transformation (like rotation, scaling, or shear) is fully described by the landing positions of the basis vectors and .
- The coordinates of these transformed basis vectors form the columns of the 2x2 transformation matrix.
- Translation is not a linear transformation because it moves the origin, so it cannot be represented by a 2x2 matrix.
- By using homogeneous coordinates—representing 2D points as 3D vectors —we can use 3x3 matrices to represent translation, rotation, and scaling within the same system.
This unification is not just an elegant mathematical trick; it is the key to computational efficiency. In our next lesson, we will explore the most important consequence of this matrix representation: composition. You will learn how to combine a long series of transformations into a single matrix by multiplying their individual matrices, a process that is at the very core of how complex parametric models are generated.