This is an old revision of the document!
Warning: Undefined array key "do" in /home/levene/public_html/w/mst10030/lib/plugins/revealjs/action.php on line 14
Table of Contents
Chapter 3: Vectors and geometry
Recall that a $2\times 1$ column vector such as $\def\m#1{\begin{bmatrix}#1\end{bmatrix}}\m{4\\3}$ is a pair of numbers written in a column. We are also used to writing points in the plane $\mathbb R^2$ as a pair of numbersl; for example $(4,3)$ is the point obtained by starting from the origin, and moving $4$ units to the right and $3$ units up.
We think of a (column) vector like $\vec v=\m{4\\3}$ as an instruction to move $4$ units to the right and $3$ units up. This movement is called “translation by $\vec v$”.
Examples
The vector $\vec v=\m{4\\3}$ moves:
- $(0,0)$ to $(4,3)$
- $(-2,6)$ to $(2,9)$
- $(x,y)$ to $(x+4,y+3)$.
It is convenient to not be too fussy about the difference between a point like $(4,3)$ and the vector $\m{4\\3}$. If we agree to write points as column vectors, then we can perform algebra (addition, subtraction, scalar multiplication) as discussed in Chapter 2, using points and column vectors.
For example, we could rewrite the examples above by saying that $\vec v=\m{4\\3}$ moves:
- $\m{0\\0}$ to $\m{0\\0}+\m{4\\3}=\m{4\\3}$
- $\m{-2\\6}$ to $\m{-2\\6}+\m{4\\3}=\m{2\\9}$
- $\m{x\\y}$ to $\m{x\\y}+\m{4\\3}=\m{x+4\\y+3}$.
More generally: a column vector $\vec v$ moves a point $\vec x$ to $\vec x+\vec v$.
Example
Which vector moves the point $A=(-1,3)$ to $B=(5,-4)$?
Answer: we need a vector $\vec v$ with $A+\vec v=B$, so $\vec v=B-A = \m{5\\-4}-\m{-1\\3}=\m{6\\-7}$. We write $\vec{AB}=\m{6\\-7}$, since this is the vector which moves $A$ to $B$.
Definition of $\vec{AB}$
If $A$ and $B$ are any points in $\mathbb{R}^n$, then the vector $\vec{AB}$ is defined by \[ \vec{AB}=B-A\] (where on the right hand side, we interpret the points as column vectors so we can subtract them to get a column vector).
Thus $\vec{AB}$ is the vector which moves the point $A$ to the point $B$.
Example
In $\mathbb{R}^3$, the points $A=(3,-4,5)$ and $B=(11,6,-2)$ have $\vec{AB}=\m{11\\6\\-2}-\m{3\\-4\\5}=\m{8\\10\\-7}$.
The uses of vectors
Vectors are used in geometry and science to represent quantities with both a magnitude (size/length) and a direction. For example:
- displacements (in geometry)
- velocities
- forces
Recall that a column vector moves points. Its magnitude, or length, is how far it moves points.
Definition: the length of a vector
If $\vec v=\m{v_1\\v_2\\\vdots\\v_n}$ is a column vector in $\mathbb{R}^n$, then its magnitude, or length, or norm, is the number \[ \|\vec v\|=\sqrt{v_1^2+v_2^2+\dots+v_n^2}.\]
Examples
- $\left\|\m{4\\3}\right\|=\sqrt{4^2+3^2}=\sqrt{16+9}=\sqrt{25}=5$
- $\left\|\m{1\\0\\-2\\3}\right\|=\sqrt{1^2+0^2+(-2)^2+3^2}=\sqrt{1+0+4+9}=\sqrt{14}$
Exercise
Prove that if $c\in \mathbb{R}$ is a scalar and $\vec v$ is a vector in $\mathbb{R}^n$, then \[ \|c\vec v\|=|c|\,\|\vec v\|.\] That is, multiplying a vector by a scalar $c$ scales its length by $|c|$, the absolute value of $c$.
The dot product
Definition of the dot product
Let $\def\m#1{\left[\begin{smallmatrix}#1\end{smallmatrix}\right]}\vec v=\m{v_1\\v_2\\\vdots\\v_n}$ and $\vec w=\m{w_1\\w_2\\\vdots\\w_n}$ be two vectors in $\mathbb{R}^n$.
The dot product of $\vec v$ and $\vec w$ is the number $\vec v\cdot \vec w$ given by \[ \color{red}{\vec v\cdot\vec w=v_1w_1+v_2w_2+\dots+v_nw_n}.\]
Note that while $\vec v$ and $\vec w$ are vectors, their dot product $\vec v\cdot \vec w$ is a scalar.
Example
If $\vec v=\m{3\\5}$ and $\vec w=\m{4\\-7}$, then $\vec v\cdot \vec w=\m{3\\5}\cdot \m{4\\-7} = 3(4)+5(-7)=-23$.
Properties of the dot product
For any vectors $\vec v$, $\vec w$ and $\vec u$ in $\mathbb{R}^n$, and any scalar $c\in \mathbb{R}$:
- $\def\dp#1#2{\vec #1\cdot \vec #2}\dp vw=\dp wv$ (the dot product is commutative)
- $\vec u\cdot(\vec v+\vec w)=\dp uv+\dp uw$
- $(c\vec v)\cdot \vec w=c(\dp vw)$
- $\dp vv=\|\vec v\|^2\ge 0$, and $\dp vv=0 \iff \vec v=0_{n\times 1}$
The proofs of these properties are exercises.
Angles and the dot product
Theorem: the relationship between angle and the dot product
If $\vec v$ and $\vec w$ are non-zero vectors in $\mathbb{R}^n$, then \[ \dp vw=\|\vec v\|\,\|\vec w\|\,\cos\theta\] where $\theta$ is the angle between $\vec v$ and $\vec w$.
The proof will be given soon, but for now here is an example.
Example
If $\vec v=\m{1\\2}$ and $\vec w=\m{-2\\1}$, then $\dp vw=1(-2)+2(1)=-2+2=0$. On the other hand, we have $\|\vec v\|=\sqrt5=\|\vec w\|$, so the angle $\theta$ between $\vec v$ and $\vec w$ satisfies \[ 0=\dp vw=\sqrt 5\times \sqrt 5 \times \cos\theta\] so $5\cos\theta=0$, so $\cos\theta=0$, so $\theta=\pi/2$ or $\theta=3\pi/2$ (measuring angles in radians). This tells us that the angle between $\vec v$ and $\vec w$ is a right angle. We say that these vectors are orthogonal. We can draw a convincing picture which indicates that these vectors are indeed at right angles:
Proof of the Theorem
We wish to show that $\def\vv{\vec v} \def\ww{\vec w}\vv\cdot\ww=\|\vv\|\,\|\ww\|\cos\theta$ where $\theta$ is the angle between $\vv$ and $\ww$.
Recall the cosine rule:
Consider a triangle with two sides $\vv$ and $\ww$. By the triangle rule for vector addition, the third side $\vec x$ has $\ww+\vec x=\vv$, so $\vec x=\vv-\ww$:
Applying the cosine rule gives \[ \|\vv-\ww\|^2=\|\vv\|^2+\|\ww\|^2-2\|\vv\|\,\|\ww\|\,\cos\theta.\] On the other hand, we know that $\|\vec x\|^2=\vec x\cdot\vec x$, so \begin{align*}\|\vv-\ww\|^2&=(\vv-\ww)\cdot(\vv-\ww)\\&=\vv\cdot\vv+\ww\cdot\ww-\ww\cdot\vv-\vv\cdot\ww\\&=\|\vv\|^2+\|\ww\|^2-2\vv\cdot\ww.\end{align*} So \[\|\vv\|^2+\|\ww\|^2-2\|\vv\|\,\|\ww\|\,\cos\theta=\|\vv\|^2+\|\ww\|^2-2\vv\cdot\ww\cos\theta.\] Subtracting $\|\vv\|^2+\|\ww\|^2$ from both sides and dividing by $-2$ gives $\vv\cdot\ww=\|\vv\|\,\|\ww\|\cos\theta$. ■
Corollary
If $\vv$ and $\ww$ are non-zero vectors and $\theta$ is the angle between them, then $\cos\theta=\displaystyle\frac{\vv\cdot\ww}{\|\vv\|\,\|\ww\|}$.
Corollary
If $\vv$ and $\ww$ are non-zero vectors with $\vv\cdot\ww=0$, then $\vv$ and $\ww$ are orthogonal: they are at right-angles.
Examples
- The angle $\theta$ between $\def\c#1#2{\begin{bmatrix}#1\\#2\end{bmatrix}}\c12$ and $\c3{-4}$ has \[ \cos\theta=\frac{\c12\cdot\c3{-4}}{\left\|\c12\right\|\,\left\|\c3{-4}\right\|} =\frac{3-8}{\sqrt5\sqrt{25}}=-\frac1{\sqrt5},\] so $\theta=\cos^{-1}(-1/\sqrt5) \approx 2.03\,\text{radians}\approx 116.57^\circ$.
- The points $A=(2,3)$, $B=(3,6)$ and $C=(-4,5)$ are the vertices of a right-angled triangle. Indeed, we have $\vec{AB}=\c36-\c23=\c13$ and $\vec{AC}=\c{-4}5-\c23=\c{-6}2$, so $\vec{AB}\cdot\vec{AC}=\c13\cdot\c{-6}2=1(-6)+3(2)=0$, so the sides $AB$ and $AC$ are at right-angles.
- To find a unit vector orthogonal to the vector $\vv=\c12$, we can first observe that $\ww=\c{-2}1$ has $\vv\cdot\ww=0$, so $\vv$ and $\ww$ are orthogonal; and then consider the vector $\vec u=\frac1{\|\ww\|}\ww$, which is a unit vector in the same direction as $\ww$, so is also orthogonal to $\vv$. Hence $\vec u=\frac1{\sqrt5}\c{-2}1=\c{-2/\sqrt5}{1/\sqrt5}$ is a unit vector orthogonal to $\vv=\c12$.
The orthogonal projection of one vector onto another
Let $\def\ww{\vec{w}}\def\vv{\vec{v}}\def\uu{\vec{u}}\ww$ be a non-zero vector, and let $\vv$ be any vector. We call a vector $\def\pp{\vec p}\def\nn{\vec{n}}\pp$ the orthogonal projection of $\vv$ onto $\ww$, and write $\pp=\def\ppp{\text{proj}_{\ww}\vv}\ppp$, if
- $\pp$ is in the same direction as $\ww$; and
- the vector $\nn=\vv-\pp$ joining the end of $\pp$ to the end of $\vv$ is orthogonal to $\ww$.
We can use these properties of $\pp$ to find a formula for $\pp$ in terms of $\vv$ and $\ww$.
- Since $\pp$ is in the same direction as $\ww$, we have $\pp=c\ww$ for some scalar $c\in \mathbb{R}$.
- Since $\nn=\vv-\pp$ is orthogonal to $\ww$, we have $\nn\cdot \ww=0$. Hence \begin{align*}&&(\vv-\pp)\cdot \ww&=0\\&\implies& \vv\cdot\ww-\pp\cdot\ww&=0\\&\implies& \pp\cdot\ww&=\vv\cdot\ww\\&\implies& c\ww\cdot \ww&=\vv\cdot\ww\\&\implies& c\|\ww\|^2&=\vv\cdot\ww\\&\implies& c&=\frac{\vv\cdot\ww}{\|\ww\|^2}.\end{align*}
So we obtain the orthogonal projection formula: \[ \pp=\ppp=\frac{\vv\cdot\ww}{\|\ww\|^2}\ww.\]
We call $\nn=\vv-\ppp$ the component of $\vv$ orthogonal to $\ww$.
Example
If $\def\vv{\vec v}\def\pp{\vec p}\def\ppp{\text{proj}_{\ww}\vv}\def\ww{\vec w}\def\nn{\vec n}\vv=\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\c12{-1}$ and $\ww=\c2{-1}4$, then \begin{align*}\ppp&=\frac{\vv\cdot\ww}{\|\ww\|^2}\ww\\&=\frac{2-2-4}{2^2+(-1)^2+4^2}\c2{-1}4\\&=-\frac4{21}\c2{-1}4\end{align*} and the component of $\vv$ orthogonal to $\ww$ is \begin{align*}\nn&=\vv-\ppp\\&=\c12{-1}-\left(-\frac4{21}\right)\c2{-1}4\\&=\c12{-1}+\c{8/21}{-4/21}{16/21}\\&=\c{29/21}{38/21}{-5/21}.\end{align*}
The cross product of vectors in $\mathbb{R}^3$
Definition: the standard basis vectors
We define $\def\i{\vec \imath}\i=\def\c#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}}\c100$, $\def\j{\vec \jmath}\j=\c010$ and $\def\k{\vec k}\k=\c001$. These are the standard basis vectors of $\mathbb{R}^3$.
Note that any vector $\vec v=\c{v_1}{v_2}{v_3}$ may be written as a linear combination of these vectors (that is, a sum of scalar multiplies of $\i$, $\j$ and $\k$), since \[ \def\vc#1{\c{#1_1}{#1_2}{#1_3}}\vec v=\vc v=\c{v_1}{0}{0}+\c{0}{v_2}{0}+\c{0}{0}{v_3} = v_1\i+v_2\j+v_3\k.\]
Definition: the cross product
If $\vec v=\vc v$ and $\vec w=\vc w$ are vectors in $\mathbb{R}^3$, then we define $\def\vv{\vec v}\vv\times\def\ww{\vec w}\ww$ to be the vector given by the determinant \[ \vv\times\ww=\def\cp#1#2#3#4#5#6{\begin{vmatrix}\i&\j&\k\\#1\\#4\end{vmatrix}}\def\cpc#1#2{\cp{#1_1}{#1_2}{#1_3}{#2_1}{#2_2}{#2_3}}\cpc vw.\] We interpret this determinant by expanding along the first row: \[\vv\times\ww=\cpc vw=\def\vm#1{\begin{vmatrix}#1\end{vmatrix}}\vm{v_2&v_3\\w_2&w_3}\i-\vm{v_1&v_3\\w_1&w_3}\j+\vm{v_1&v_2\\w_1&w_2}\k=\c{v_2w_3-v_3w_2}{-(v_1w_3-v_3w_1)}{v_1w_2-v_2w_1}\]
Example
Let $\vv=\c13{-1}$ and $\ww=\c21{-2}$. We have \[ \vv\times\ww=\cp13{-1}21{-2}=\c{3(-2)-1(-1)}{-(1(-2)-(-1)2)}{1(1)-3(2)}=\c{-5}0{-5}\] and \[ \ww\times\vv=\cp21{-2}13{-1}=\c{1(-1)-(-2)3}{-(2(-1)-(-2)1)}{2(3)-1(1)}=\c{5}0{5}.\] Observe that $\vv\times\ww=-\ww\times \vv$. Moreover, \[ \vv\times \vv=\cp13{-1}13{-1}=\c000=\vec0\] and \[ \ww\times\ww=\cp21{-2}21{-2}=\c000=\vec0.\]
Example: cross products of standard basis vectors
We have \[ \i\times\j=\cp100010=\c001=\k,\] \[ \j\times\k=\cp010001=\c100=\i\] \[ \k\times\i=\cp001100=\c010=\j\]
Proposition: properties of the cross product
For any vectors $\def\uu{\vec u}\uu$, $\vv$ and $\ww$ in $\mathbb{R}^3$ and any scalar $c\in\mathbb{R}$, we have:
- $\uu\times(\vv+\ww)=\uu\times\vv+\uu\times\ww$
- $\vv\times\ww=-\ww\times\vv$
- $(c\vv)\times \ww=c(\vv\times\ww)=\vv\times(c\ww)$
- $\vv\times\vv=\vec0$
- $\vv\times \vec0=\vec0$
- $\vv\times \ww$ is orthogonal to both $\vv$ and $\ww$
Proof
- This is a tedious (but easy) bit of algebra.
- Swapping two rows in a determinant changes the sign, so \[ \vv\times\ww=\cpc vw=-\cpc wv=-\ww\times\vv.\]
- Scaling one row in a determinant scales the determinant in the same way, so \[ (c\vv)\times\ww=\cpc {cv}w=c\cpc vw=c\vv\times\ww.\]
- The determinant of a matrix with a repeated row is zero.
- The determinant of a matrix with a zero row is zero.
- Observe that $\uu\cdot (\vv\times \ww)=\vm{u_1&u_2&u_3\\v_1&v_2&v_3\\w_1&w_2&w_3}$. The determinant of a matrix with a repeated row is zero, so \[\vv\cdot (\vv\times \ww)=\vm{v_1&v_2&v_3\\v_1&v_2&v_3\\w_1&w_2&w_3}=0\] so $\vv$ is orthogonal to $\vv\times\ww$; and similarly, \[\ww\cdot(\vv\times \ww)=\vm{w_1&w_2&w_3\\v_1&v_2&v_3\\w_1&w_2&w_3}=0\] so $\ww$ is orthogonal to $\vv\times\ww$. ■
Theorem: the dot product/cross product length formula
For any vectors $\vv$ and $\ww$ in $\mathbb{R}^3$, we have \[ \|\vv\times\ww\|^2+(\vv\cdot\ww)^2=\|\vv\|^2\,\|\ww\|^2.\]
Proof
Let $D$ be the sum of $v_i^2w_j^2$ over all $i,j\in\{1,2,3\}$ with $i=j$. (So $D=v_1^2w_1^2+v_2^2w_2^2+v_3^2w_3^2$.)
Let $F$ be the sum of $v_i^2w_j^2$ over all $i,j\in\{1,2,3\}$ with $i\ne j$. (So $F=v_1^2w_2^2+v_2^2w_1^2+\dots+v_3^2w_2^2$, with 6 terms on the right hand side.)
Let $C$ be the sum of $v_iw_iv_jw_j$ over all $i,j\in\{1,2,3\}$ with $i<j$. (So $C=v_1w_1v_2w_2+v_1w_1v_3w_3+v_2w_2v_3w_3$.)
Then $D+F$ is the sum of $v_i^2w_j^2$ over all $i,j\in \{1,2,3\}$.
Expanding the formulae for $\|\vv\|^2$ and $\|\ww\|^2$, we get $\|\vv\|^2\|\ww\|^2=D+F$.
Expanding the formula for the cross product, we get $\|\vv\times\ww\|^2=F-2C$.
Expanding the formula for the dot product, we get $(v\cdot w)^2=D+2C$.
So $\|\vv\times\ww\|^2+(v\cdot w)^2=F-2C+D+2C=F+D=\|\vv\|^2\|\ww\|^2.■$
Corollary: the length of $\vec v\times\vec w$
For any vectors $\vv$ and $\ww$ in $\mathbb{R}^3$, we have \[ \|\vv\times\ww\|=\|\vv\|\,\|\ww\|\,\sin\theta\] where $\theta$ is the angle between $\vv$ and $\ww$ (with $0\le\theta\le\pi$).
Proof
Recall that $\vv\cdot\ww=\|\vv\|\,\|\ww\|\cos\theta$. Now \begin{align*}\|\vv\times\ww\|^2&= \|\vv\|^2\,\|\ww\|^2-(\vv\cdot\ww)^2\\ &=\|\vv\|^2\,\|\ww\|^2-\|\vv\|^2\|\ww\|^2\cos^2\theta\\ &=\|\vv\|^2\,\|\ww\|^2(1-\cos^2\theta)\\ &=\|\vv\|^2\,\|\ww\|^2\sin^2\theta.\end{align*} Since $\sqrt {a^2}=a$ if $a\ge0$ and $\sin\theta\ge0$ for $0\le\theta\le\pi$, taking square roots of both sides gives \[ \|\vv\times\ww\|=\|\vv\|\,\|\ww\|\,\sin\theta. ■ \]
Geometry of the cross product
Let $\def\vv{\vec v}\vv$ and $\def\ww{\vec w}\ww$ be vectors in $\def\bR{\mathbb{R}}\bR^3$.
The area of a triangle
Consider a triangle with sides $\vv$ and $\ww$ (and a third vector, namely $\vv-\ww$). Thinking of $\vv$ as the base, the length of the base is $b=\|\vv\|$ and the height of this triangle (measured at right angles to the base) is $h=\|\ww\|\sin \theta$ where $\theta$ is the angle between $\vv$ and $\ww$.
Hence the area of this triangle is $\tfrac12 bh=\tfrac12\|\vv\|\,\|\ww\|\sin\theta$, which is equal to $\tfrac12\|\vv\times\ww\|$ (by the formula for $\|\vv\times\ww\|$ which appears above).
