How Linear Transformations Are Defined- A Primer
What Is a Linear Transformation?
A linear transformation is a function that maps vectors to vectors while preserving two basic operations: vector addition and scalar multiplication. That's the core idea. Everything else flows from that.
In simpler terms, if you have a transformation T, and you feed it two vectors, the result of adding those vectors first and then transforming should equal transforming each vector separately and then adding the results. Same deal with scaling. This property is what makes the transformation "linear."
You see these everywhere in computer graphics, physics, machine learning, and data science. If you've ever rotated an image, scaled a 3D model, or reduced dimensions in a dataset, you worked with linear transformations.
The Formal Definition
Let T be a function from ℝⁿ to ℝᵐ. T is a linear transformation if and only if both of these hold for all vectors u and v and all scalars c:
- Additivity: T(u + v) = T(u) + T(v)
- Scalar multiplication: T(cu) = cT(u)
That's it. Two conditions. If a transformation breaks either one, it's not linear.
One immediate consequence: T(0) must equal 0. Plug in u = 0 and c = 0, and you get T(0) = 0. This alone kills a lot of supposed "linear" transformations. A function that translates points by a fixed amount? Not linear. It fails this test.
Visualizing Linear Transformations
Linear transformations do three things to space (or n-dimensional space):
- Rotate it
- Scale it (stretch or compress)
- Shear it (tilt it)
They can also reflect it, which is just a special case of scaling where one dimension flips sign.
What they cannot do is curve lines into curves, translate points to new locations, or change the origin. The origin always stays fixed. This is non-negotiable for linear transformations.
Common Types of Linear Transformations
Rotation
Spins vectors around the origin by a fixed angle. In 2D, a rotation by angle θ looks like this:
Matrix form:
| Transformation | Matrix | What it does |
|---|---|---|
| Rotation by θ | [cos θ, -sin θ; sin θ, cos θ] | Rotates vectors by θ counterclockwise |
| Scaling | [a, 0; 0, b] | Stretches by factor a in x, b in y |
| Reflection (x-axis) | [1, 0; 0, -1] | Flips the y-coordinate |
| Reflection (y-axis) | [-1, 0; 0, 1] | Flips the x-coordinate |
| Shear (horizontal) | [1, k; 0, 1] | Shifts x based on y value |
| Shear (vertical) | [1, 0; k, 1] | Shifts y based on x value |
All of these preserve the origin and satisfy the two conditions. You can verify each one by plugging vectors through the additivity and scalar multiplication tests.
Scaling
Multiplies each coordinate by a constant. Uniform scaling uses the same factor for all dimensions. Non-uniform scaling uses different factors, which distorts shapes.
Reflection
Flips coordinates across an axis or line. The matrix has 1s on the main diagonal and -1s where you want the flip. Simple, predictable, easy to verify.
Shear
Slants the coordinate system. One axis gets shifted proportionally to the other. Horizontal shear shifts x based on y. Vertical shear shifts y based on x. The parameter k controls the intensity.
The Matrix Connection
Every linear transformation from ℝⁿ to ℝᵐ corresponds to exactly one m×n matrix. Conversely, every m×n matrix defines a linear transformation.
The relationship is direct: if T(x) = Ax, then T is linear. Multiply the matrix A by any vector x, and you get the transformed vector.
This means you can study linear transformations entirely through matrices. The two subjects are inseparable once you're working in finite dimensions.
To find the matrix for a transformation, apply it to each basis vector and write the results as columns. Those columns form the matrix. This works every time.
How to Tell If a Transformation Is Linear
Here's the practical test. Given T: ℝⁿ → ℝᵐ, check these two things:
- Does T(0) = 0? If not, stop. It's not linear.
- Pick two random vectors u and v, and a random scalar c. Compute T(u + v) and compare it to T(u) + T(v). Then compute T(cu) and compare it to cT(u). If both match, you have a linear transformation.
Common functions that are not linear:
- T(x) = x + b (adds a constant) — fails the origin test
- T(x) = ||x|| (norm function) — fails additivity
- T(x) = x² (squaring) — fails scalar multiplication for negative scalars
Composition of Linear Transformations
Apply one transformation after another: T₂(T₁(x)). This is just matrix multiplication. If T₁ has matrix A and T₂ has matrix B, the composition has matrix BA.
Order matters. BA is usually not equal to AB. Rotations and scaling commute. Rotations and shears don't.
Getting Started: Working with Linear Transformations
Here's how to actually use this:
- Identify the input and output dimensions. How many coordinates go in? How many come out?
- Write the transformation in matrix form. If you know what the transformation does to basis vectors, you have your matrix.
- Apply it to vectors you care about. Multiply the matrix by each input vector.
- Check your work. Verify the origin maps to origin. Test additivity on one example.
Example: You want to rotate the point (1, 0) by 90° counterclockwise.
Matrix: [0, -1; 1, 0]
Multiply: [0, -1; 1, 0] × [1; 0] = [0; 1]
Result: (1, 0) becomes (0, 1). That's correct for a 90° counterclockwise rotation.
Eigenvalues and Eigenvectors
Some vectors don't change direction under a transformation. They get scaled, but they stay on the same line. These are eigenvectors. The scaling factor is the eigenvalue.
Mathematically: Av = λv, where A is the matrix, v is the eigenvector, and λ is the eigenvalue.
This matters in PCA, vibration analysis, quantum mechanics, and anywhere you need to find principal directions of a transformation.
What Linear Transformations Cannot Do
Keep this list in mind. If you need any of these, linear transformations won't cut it:
- Translate (move) objects — needs affine transformation
- Curve a straight line — needs nonlinear transformation
- Map the origin somewhere else — impossible by definition
- Change the dimensionality nonlinearly — needs something like neural networks
Affine transformations extend linear ones by adding translation. They look like T(x) = Ax + b. That's not linear by the strict definition, but it's linear followed by a shift.
The Short Version
Linear transformations preserve vector addition and scalar multiplication. They correspond one-to-one with matrices. They rotate, scale, shear, and reflect space. They fix the origin. That's the entire definition.
Everything else — eigenvalues, composition, change of basis — builds from those two conditions. Master those, and the rest follows.