\documentclass[12 pt] {article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{url}
\usepackage[left=1.0 in, right=0.5 in, top=1.5 in, bottom=1.0 in]{geometry}
%\pagestyle{empty}
\title{Lesson on Matrices and then Some}
\author{GF, for Math198 on M6}
\date{27 September 2016 (rev 28sep16)}

\begin{document}
\maketitle
\section{Introduction}
\includegraphics[scale=.8]{mat.png}
Here is a (partial) writeup of what I said at the whiteboard on M6. It is
also a LaTeX document, and hence a useful example of how to write it. For 
example, this first image is a screen print of the code that composed 
this matrix. If you wish to see its LaTeX code, open matricesM6.tex in 
a text processor.  
\[
\begin{bmatrix}
    x_{11}       & x_{12} & x_{13} & \dots & x_{1n} \\
    x_{21}       & x_{22} & x_{23} & \dots & x_{2n} \\
    \hdotsfor{5} \\
    x_{d1}       & x_{d2} & x_{d3} & \dots & x_{dn}
\end{bmatrix}
=
\begin{bmatrix}
    x_{11} & x_{12} & x_{13} & \dots  & x_{1n} \\
    x_{21} & x_{22} & x_{23} & \dots  & x_{2n} \\
    \vdots & \vdots & \vdots & \ddots & \vdots \\
    x_{d1} & x_{d2} & x_{d3} & \dots  & x_{dn}
\end{bmatrix}
\]
Note that the subscripting begins the natural numbers at 1. We
shall get used to counting from 0 and ending one short of how many
items we enumerate. Also note that the author has a mnemonic name 
for the final index pair, "d" for "down" but "n" for the horizontal 
extent. 

I mentioned that physics uses sub and superscripts. But for most of
you this is not memorable at the moment. But we do think of points
and vectore in 2, 3 and 4 space as columns. Hence a matrix can be
considered (horizontal)
vector of column vectors. However you may have learned to multiply 
matrices here is  an equivalent way which has more geometrical meaning.

Finally note another LaTeX thing you'll have to get used. First, LaTeX
has its own typesetting rules where to put images relative to the text.
Second, we (absentmidedly) make a mistake above (only one? I hope). We
wrote "d" instead of ``d". See the difference. The begin quotation symbol
is made with two back-tics (upper left on your keyboard). Get used to that
too.

\section{Matrix times Vector}
We interpret the product
\[ \begin{bmatrix} 
a & d & g \\
b & e & h \\
c & f & g \\
\end{bmatrix}
\begin{bmatrix}
x \\ y \\ z \\
\end{bmatrix} =
\begin{bmatrix} a\\ b\\ c\\ \end{bmatrix} x +
\begin{bmatrix} d\\e\\f\\ \end{bmatrix} y +
\begin{bmatrix} g\\h\\k\\ \end{bmatrix} z =
\begin{bmatrix} 
ax + dy + gz \\
bx + ey + hz \\
cx + fy + kz \\
\end{bmatrix} \]
with the same result (rightmost) you would expect from highschool.

Of course, we don't like to burden our typing with a lot of extra letters 
that serve no particular purpose. So we might write the the matrix as 
a row-vector and, if necessary, decorate the letters that represent entire
column-vectors some conventional way, or not at all (being mathematicians,
apprentice or otherwise.) Thus
\[ 
\begin{bmatrix}
\overrightarrow{k_0} &  \underline{k_1} & K_2 \\
\end{bmatrix} \underline{x} = 
\underline{k_0} x_0 + \underline{k_1} x_1 + \underline{k_2} x_2 \]
Which decoration do think I like best? Note also that if $\underline{x}$
denotes a vector, it is natural to name its components $x_0, x_1, x_2$.

What does this mean? Think of the columns of the matrix as the coordinats
of three points in space, and also for the vector pointing from the 
origin to that point. (This is a common double meaning in analytic geometry.)
So it is a coordinate system somebody has sat on and deformed from the usual
unit and mutually perpendicular coordinate axes.
The  coordinates of the point being \emph{transformed} by the matrix
is the point at the end of the \emph{linear combination}, namely the 
sum of product of the axes vectors by the coordinates of the point 
$x$. We'll keep loosing that underline decoration for ease of typing, if 
not for ease of reading. Get used to inferring the context. 

The technical term for this is an \textit{axonometric transformation} 
and then we can distinguish the \emph{axons}, which are vectors, from
the \emph{axes}, which are infinite lines through the vectors.

Note that I have just introduced you to the custom of emphasizing technical
words, also called \emph{jargon},  using the italic font. It written 
``escape emph{...}" in the .tex file. We can reserve quotes for what
they are historically meant for. If you're writing by hand, and can't really
write italics, use the convention of underlining what is meant to appear
in italics. So ... no more ``air quotes". (This is correct, because air 
quotes aren't part of English orthography yet, so we use quotes to mean
an ironic or metaphoric use of the phrase inside them.)

\section{Product of Two Matrices}
We next apply a common mathematical method of \emph{generalizing}, in 
this case that of matrix multiplication. Suppose we want to multiply 
two matrices in the \emph{same way} that we multiplied a matrix and 
a vector. Thus given two matrices $M, P=[p_0,p_1,p_2]$ we define
\[ MP = [Mp_0,Mp_1,Mp_2] \]. Thus the axons (column vectors) of 
the product $MP$ consists of the M-transformed the axons 
of $P$. 

Since multiplication of numbers is associative, so too shall matrix
multiplication be. And we can write 
\[  MP\underline{x} = (MP)\underline{x} = M(P\underline{x}). \]
You already know what the first association means (but explain it 
when you rewrite this lesson in you Journal in your own words, with  
examples.)

The second shows that matrix multiplication represents composition of
two transformations, one after the other. (Careful, we read "after"
from right to left, like functional composition, not like spelling a
word.) The third is why all of this is important in computer graphics
(and math, of course.)

Suppose moment the axons in both $M,P$ are independent, even two 
sets of \emph{orthogonal frames}, a.k.a mutually perpendicular unit
vectors. The we can read the composition $MPx$ as \emph{placing}
the coordinates of $\underline{x}$ not into the usual coordinate 
system, but in the axonometric coordinate system given by the columns
of $P$. Then we place those into the axonometric coordinate system
given by the columns of $M$. 

So a matrix also has two meaning (like the coordinates of a point
and its vector). As a transformation that \emph{moves} every point
in space to a new location. For instance, a rotation. Or, as the 
axons of a new coordinate system. One likes to call the former the
\emph{alibi} approach: the culprit has changed places. The latter
becomes the \emph{alias} approach, the culprit has new names 
depending on which coordinates you use. 

\textbf{Exercise 1.} Give a change from a Cartesian (rectangular) coordinate
system in the plane to polar coordinates a alibi-interpretation!

\textbf{Exercise 2.} Give the composition of two rotations $MP$
an alias-interpretation. 

\textbf{Exercise 3.} Put the solution of these exercises into your Journal. 

\textbf{Exercise 4.}Then, someday
later (but not too much later), type this into LaTeX as an exercise in
writing LaTeX. Obviously you can copy code from this document, 
shamelessly. Put this into your repository in a subfolder name LaTeX.

\section{Omissions}
I added a lot of detail here that I surely did not say, however hurriedly
on Monday. But I also left some stuff out. Perhaps you can fill that in
from your class notes and memory?
It was about \emph{translations} not being represented by matrix 
multiplication. But if you add on dimension and use homogeneous coordinates
then even translation becomes a matrix multiplication. That is how computer
graphics libraries work.  But that must have its own lesson someday soon.

Also recall the body language that showed that products of two rotations
are rarely commutative. (Think, when would they be so?)

\end{document}




