Sometimes called as the “scaler product” because it produces a scaler
Let a,b be vectors rooted at the same point and let θ denote the smaller of the two angles between them (0≤θ≤π), the geometric definition of dot product is
> ##### Find the angle between the vectors $\vec{v}=(1, 2, 3)$ and $\vec{w} = (1, 1, -2)$
>
> From the algebraic definition of the dot product, get:
> $$
> \vec{v} \cdot \vec{w}=1(1) + 2(1) + 3(-2) = -3
> $$
> From the geometric definition, get:
> $$
> \vec{v} \cdot \vec{w}=\left\|\vec{v}\right\| \left\|\vec{w}\right\| \cos \theta
> = \sqrt{14} \sqrt{6} \cos \theta = 2 \sqrt{21} \cos \theta
> $$
> Equating the two definitions, get:
> $$
> \cos \theta = \frac{-3}{2 \sqrt{21}}
> $$
> Therefore $\theta = \arccos (\frac{-3}{2 \sqrt{21}})$
- Dot products can be used to compute the length of vectors $\vec{a} \cdot \vec{a} =\left\|\vec{a}\right\| \left\|\vec{a}\right\| \cos 0= \left\|\vec{a}\right\|^2$
- Dot products has the same distributive laws as other variables [ex. $a \cdot (b + c) = ab + ac$ etc.]
- The **<u>distance</u>** between two vectors $\vec{u}$ and $\vec{v}$ is $\left\|\vec{v} - \vec{u} \right\|$
- <u>**Unit vector**</u> - a vector $\vec{v}$ is called a unit vector if $\left\|\vec{v}\right\| = 1$
### Orthogonality
- <u>Orthogonal</u> - Two vectors $\vec{u}, \vec{v}$ are **orthogonal** (perpendicular) to each other if $\vec{u} \cdot \vec{u} = 0$
- The definition of orthogonal encapsulates *both* the idea of two vectors forming a right angle and the idea of one of them being $\vec{0}$
- <u>Direction</u> - The vector $\vec{u}$ points in the **direction** of the vector $\vec{v}$ if $k\vec{u} = \vec{v}$ for some scalar $k$. The vector $\vec{u}$ points in the **positive direction** of $\vec{v}$ if $k\vec{u} = \vec{v}$ for some *positive* scalar $k$
## Normal Vector
- <u>Normal vector</u> to a line (or plane or hyperplane) is a non-zero vector that is orthogonal to all direction vectors for the line (or plane or hyperplane)
- <u>Normal form of a line</u> - a line $\ell \subseteq \R^2$ is expressed in **normal form** if $\ell$ is the solution set to equation:
\vec{n} \cdot (\vec{x} - \vec{p}) = 0
Where $\vec{n}$ and $\vec{p}$ are fixed vectors
> ##### Find vector form and normal form of the plane $\mathcal{P}$ passing through the points $A=(1, 0, 0), B=(0, 1, 0), C=(0, 0, 1)$ .
>
> Get the 2 directional vectors from these 3 points
> $$
> \vec{d}_1 = \overrightarrow{AB} = \begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix}
> \quad \quad \quad
> \vec{d}_2 = \overrightarrow{AC} = \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix}
> $$
> Using point $A$ and the directional vectors, get the expression of $\mathcal{P}$
> $$
> \begin{bmatrix} x \\ y \\ x \end{bmatrix} =
> t\begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix} +
> s\begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix} +
> \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}
> $$
> Use $\vec{n} \cdot \vec{d}_1 = 0 = \vec{n} \cdot \vec{d}_2$
> $$
> \vec{n} \cdot (\begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix} +
> \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix})
> \quad \Rightarrow \quad
> \vec{n} \cdot \begin{bmatrix} -2 \\ 1 \\ 1 \end{bmatrix} = 0
> \quad \Rightarrow \quad
> -2\vec{x} + \vec{y} + \vec{z} = 0
> $$
> So $\vec{n} = (1, 1, 1)$, therefore the normal form of $\mathcal{P}$ can be expressed as
> $$
> \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} \cdot \left(
> \begin{bmatrix} x \\ y \\ z \end{bmatrix} -
> \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} \right) = 0
> $$
- <u>Hyperplane</u> - the set $X \subseteq \R^n$ is called a **hyperplane** if there exists $\vec{n} \neq \vec{0}$ and $\vec{p}$ so that $X$ is the set of solutions to the equation $\vec{n} \cdot (\vec{x} - \vec{p}) = 0$
- $\vec{n} \cdot (\vec{x} - \vec{p}) = 0$ If and only if $\vec{n} \cdot \vec{x} = \vec{n} \cdot \vec{p} = \alpha$ Since $\vec{n}$ and $\vec{p}$ are fixed, $\alpha$ is a constant then:
$$
\vec{n} \cdot (\vec{x} - \vec{p}) = \vec{n} \cdot \vec{x} -\alpha =
n_x x + n_y y + n_z z - \alpha = 0
$$
Therefore, $\mathcal{P}$ is the set of solutions to $n_x x + n_y y + n_z z = \alpha$ (\*)
- This (\*) equation is called the *scalar form* of a plane.
> ##### Let $\mathcal{Q} \subseteq \R^3$ be the plane passing through $\vec{p}=(1,1,0)$ and with normal vector $\vec{n}=(1,1,1)$, write $\mathcal{Q}$ in vector form
>
> $\mathcal{Q}$ Is the set of solutions to $\vec{n} \cdot (\vec{x} - \vec{p}) = 0$ , where $\alpha = 1(1)+1(1)+0(1)=2$, then
> $$
> \vec{n} \cdot (\vec{x} - \vec{p}) = \vec{n} \cdot \vec{x} -\alpha =
> x + y + z - 2= 0
> $$
> Rearranging, get $\mathcal{Q}$ as the set of all solutions to $x + y + z = 2$
>
> Using row reduction algorithm to write the complete solution, get
> $$
> \begin{bmatrix} x \\ y \\ x \end{bmatrix} =
> t\begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix} +
> s\begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix} +
> \begin{bmatrix} 2 \\ 0 \\ 0 \end{bmatrix}
> $$
---
# Matrices
- <u>Matrix</u> - grid of numbers surrounded by round or square brackets
- <u>Dimensions</u> (shape or size) of a matrix is the #rows $\times$ #columns
- <u>Entry</u> - the number in the row and column (ex. $(i, j)$ Is the $i$th row and $j$th column)
- Use capital letters to name the matrix
> $A = \begin{bmatrix} 1 & 2 & -1 \\ 3 & 0 & 7 \end{bmatrix}$ Is a $2 \times 3$ matrix, the $(2, 1)$ entry of $A$ is $a_{21} = 3$
- Matrix terminology
- Square matrix -- #rows = #columns
- Diagonal matrix -- all off-diagonal entries are zero
- Upper triangular -- all below-diagonal entries are zero
- Lower triangular -- all above-diagonal entries are zero
- <u>Identity matrix</u> - a *square* *diagonal* matrix