liveBook · Manning

Linear transformation

As explained in Geometry for Programmers

A linear transformation is a mapping in which each output coordinate is a linear combination of the input coordinates and the origin maps to the origin.

A linear transformation maps each output coordinate to a linear combination of input coordinates. In two dimensions, a square matrix performs this mapping: it can rotate, scale, or skew shapes, but it always leaves the origin fixed. Translation therefore lies outside the linear case. section 4.2.1

Matrix representation makes several useful operations straightforward:

  • Compose transformations by multiplying their matrices. section 4.2.1
  • Reverse an invertible transformation by computing its inverse matrix. section 4.2.1
  • Use affine transformations when translation is required, or projective transformations when shear is also needed. section 4.2.5

Recovering a transformation with SymPy

Given two input points and their transformed coordinates, solve four coordinate equations for the four matrix entries. SymPy can produce symbolic expressions for a11, a12, a21, and a22, turning point correspondences into an explicit transformation matrix.

How Geometry for Programmers covers it

How deep it goes
Explains coordinate formulas, matrix algebra, composition, inversion, and symbolic recovery, but stops short of formal proof.
Examples
Uses rotation and scaling formulas, Euclidean shape figures, and a SymPy system that recovers a matrix from two point mappings.
What it assumes
Assumes familiarity with coordinates, linear combinations, and square-matrix multiplication.
What you can do after
Build it from scratch by expressing coordinate mappings as matrices, composing them, inverting them, or solving for unknown entries.
How it connects
Connects rotation, scaling, translation, affine transformation, projective transformation, shear, and matrix multiplication.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.