Linear Transformations
A linear transformation moves vectors around but keeps lines straight and the origin fixed, because it plays fair with adding and scaling. Every matrix gives you one, .
What the symbols mean
- Transformation
A function from vectors to vectors.
Explanation
A linear transformation is simply a rule that takes every vector and moves it somewhere else, in a way that plays fair with adding and scaling. It's called linear because it keeps straight lines straight (at worst it squashes one down to a single point), and transformation is just the word for a function that moves vectors around. It's good for describing rotations, reflections, stretches and shears, which is everything a graphics engine does to a 3D model. The two rules above have just a few pieces: (the rule itself, which eats a vector and returns a vector), (it doesn't matter whether you add before or after moving) and (it doesn't matter whether you scale before or after). It sounds abstract, but it's two fair-play rules; bear with it.
You've already seen one. Matrix multiplication from earlier in this unit satisfies exactly these two rules: and . So every matrix defines a linear transformation, . In the next lesson you'll see that it works the other way too: every linear transformation from to comes from a matrix.
Watch the grid. Apply a linear transformation to the whole plane: grid lines stay parallel and evenly spaced, and the origin stays put. Rotations, reflections, stretches and shears are all linear; shifting (translation) is not, because it moves the origin. There's an animation further down that shows a shear and a rotation doing this to a grid, and after it a rotation you can control yourself.
A common mistake. It's tempting to think a shift like is linear, because its formula only has plain first-power terms, just like a linear equation. It isn't: a linear transformation always sends to (use in the scaling rule: ), and this one sends to . So a quick first check for any transformation is to see where the origin goes.
Linearity is powerful. If you know where sends a few vectors, you know where it sends all their combinations: . That's the idea behind the matrix of a transformation, coming up next lesson.
Domain and codomain. An matrix sends to . The order trips people up, but think about it: only makes sense when has one entry per column, so inputs have entries, and the output has one entry per row, so entries. The range is the set of all outputs: the span of the columns, since every output is a combination of them.
See it
Worked examples
and . Find .
- 1
By linearity, , so you only need the two outputs you were given: .
Practice
Type your answer and check it. Solve them all to complete the lesson.
and . Find .
Is linear?
Is linear?
A matrix defines from which space to which?
Rotation by 90° counterclockwise sends where?
A robot arm's controller turns joint motions into hand motions linearly: moving joint 1 alone moves the hand by , and joint 2 alone by . The joints move by and units. Where does the hand go?
The hardest one here. Get it, and you've got this lesson.
A linear transformation sends to and to . Find .
Where it's used
Graphics engines move, scale and rotate every vertex of every model with linear transformations each frame; image filters and audio effects are linear transformations of pixels and samples.