Part of the linear algebra notes

Vectors

Pretty familiar with these so wont take too many notes

In matrix algebra, “column” vectors are one-column matrices, and “row” vectors are one-row matrices. Vector sums are matrix sums, vector scaling is matrix scaling, and the dot product corresponds to transposing one matrix and performing matrix multiplication with the other. In this way, matrix algebra is like a superset of vector algebra, you can encode vector algebra in matrix algebra.

Basis vectors

Vectors where one component is 1 and all the other components are 0, aka the column vectors of the identity matrix.

Right hand rule

Pointer in the direction of x, flip the bird in the direction of y, and the thumb is in the direction of z. There’s two choices for a z that’s perpendicular to both x and y, so the right hand rule decides for you.

This is more accurately a right hand convention. The left-handed coordinate system isn’t wrong, it’s just a mirror image of the right-hand system.

Consequences of the dot product

AB=ABcos(θ)A⬝B = \|A\|\|B\|\cos(θ) where A,B\|A\|, \|B\| denotes the length of AA and BB, and θθ is the angle between the vectors. (Two vectors always define a plane, so it always makes sense to talk about the angle between two vectors.)

This looks like the law of cosines and it’s not a coincidence (TODO fill this in, went over it in class)

Vectors are perpendicular when they have 90 degrees between them. Cosine of 90 degrees is 0. So the dot product of perpendiculuar vectors is 0 exactly when the vectors are perpendicular.

Projections

The projection of a vector uu onto a vector qq is denoted 𝐏𝐫𝐨𝐣qu\textbf{Proj}_q u. (In other words, the function that projects vectors onto qq is written as 𝐏𝐫𝐨𝐣q\textbf{Proj}_q.)

Book goes through this nice derivation:

  1. If v=𝐏𝐫𝐨𝐣quv = \textbf{Proj}_q u, then vv is a vector in the direction of qq and with its own length v\|v\|. So you can write vv as

    vnorm(q)\|v\| norm(q)

    where norm(q)norm(q) is q normalized to 1 unit, i.e. q/qq / \|q\|. This way the length of the vector is entirely determined by the v\|v\| term, not the length of q.

  2. From the picture you can see that v=ucos(θ)\|v\| = \|u\|\cos(θ). This is just right-triangle stuff from high school, nothing to do with the dot product

    So you can write vv as

    ucos(θ)norm(q)\|u\| \cos(θ) norm(q)

  3. If you don’t know cos(θ)\cos(θ) you can compute it with the dot product: cos(θ)=(uq)/(uq)\cos(θ) = (u⬝q) / (\|u\|\|q\|)

    So you can write vv as

    u(uq)uqnorm(q)\frac{\|u\| (u⬝q)}{\|u\|\|q\|} norm(q)

    and then cancel the u\|u\|s leaving

    uqqnorm(q)\frac{u⬝q}{\|q\|}norm(q)

TODO typeset this better lol