How to write a linear transformation as a matrix

A linear transformation respects vector addition and scalar multiplication. That means its action on the coordinate vectors tells us how it acts on every vector. Let’s use those images to build a matrix for a reflection and a stretch.

Put the coordinate-vector images in the columns

For a linear map from the plane to the plane, put T(1,0) in the first column and T(0,1) in the second. Since (x,y)=x(1,0)+y(0,1), the matrix then gives T(x,y)=xT(1,0)+yT(0,1).

Combine a horizontal stretch with a reflection

A horizontal stretch by 3 changes x to 3x. A reflection over the horizontal axis changes y to -y. Together, the transformation is T(x,y)=(3x,-y).

A=[300-1]

Transform the triangle vertices

Apply the same matrix to each vertex
Original vertexImage
(-1,4)(-3,-4)
(-3,-2)(-9,2)
(4,0)(12,0)

Connecting the images in the original order gives the transformed triangle. A matrix with m rows and n columns represents a linear map taking n-component inputs to m-component outputs.