01. Matrices

Matrices

Vectors in the plane

A vector is an arrow in the plane (later we'll deal with vectors in higher-dimensional spaces). We encode this arrow as a pair of numbers (xy) . The number x tells us how far to the right the arrow points; the number y tells us how far upwards it points. If the arrow points to the left then x is negative; if it points downwards then y is negative.

Can you match up the vectors (xy) with those in the diagram? (Some of the vectors are not depicted).

Vectors in the plane: (A) points 1 left 1 down, (B) points 1 horizontally right, (C) points 1 vertically up (D) points 2 right and 1 up

(12),(01),(11), (10),(-1-1),(21).

(answers at ).

A lot of this module will focus on the interplay between algebra (like column vectors) and geometry (like arrows in the plane).

A vector in the plane

Suppose v=(xy) is a vector. What is it's length? By Pythagoras's theorem, it's x2+y2 . I'll write this as |v| , which you can read out loud as "norm v ". The angle that v makes with the horizontal is θ=arctan(y/x) (by trigonometry). If we want to write x and y in terms of |v| and θ , we get (again, using trigonometry): x=|v|cosθ,y=|v|sinθ. So v=(|v|cosθ|v|sinθ) .

2-by-2 matrices

What happens if I rotate v by an angle ϕ anticlockwise? We get a new vector w , which we can express in terms of v and ϕ .

A vector v making an angle theta with x-axis and w (rotated anticlockwise) by phi

Rotation preserves lengths, so |w|=|v| .

The angle that w makes with the horizontal is θ+ϕ . Therefore w=(|v|cos(θ+ϕ)|v|sin(θ+ϕ)).

We can expand this using the trigonometric addition formulae: w=(|v|cos(θ+ϕ)|v|sin(θ+ϕ))=(|v|cosθcosϕ-|v|sinθsinϕ|v|sinθcosϕ+|v|cosθsinϕ).

Using x=|v|cosθ and y=|v|sinθ , we get w=(xcosϕ-ysinϕxsinϕ+ycosϕ).

This expresses w in terms of the original vector v=(xy) and the angle ϕ of rotation. We now invent a piece of notation which separates out the dependence of w on v from its dependence on ϕ : we write w=(cosϕ-sinϕsinϕcosϕ)(xy). You can just think of this as a shorthand for (xcosϕ-ysinϕxsinϕ+ycosϕ) , keeping track of where all the coefficients sit.

More generally, given a 2-by-2 array of numbers M=(abcd) and a vector v=(xy) , we define the product Mv=(abcd)(xy):=(ax+bycx+dy). This defines the action of a matrix on a vector. This notation completely separates out the rotation (M ) from the vector we started with (v ).

Now we don't have to limit ourselves to rotations: any matrix (abxd) defines a geometric transformation of the plane. This is the transformation (xy)(ax+bycx+dy). We'll see lots of examples in the next video (rotations, reflections, shears,...).

Mnemonic

How do you remember the formula for a matrix acting on a vector? The mnemonic I like is as follows. To get the first entry of Mv , you ``multiply the top row of M into v '', that is you perform the multiplications ax and by (working across the top row of M and down the column of v ) and sum them.

Diagram illustrating the mnemonic for the first entry

To get the second entry, you multiply the second row of M into v .

Diagram illustrating the mnemonic for the second entry

In the next video, we'll see lots of examples of transformations of the plane coming from 2-by-2 matrices.