Vectors, lines in space and the scalar product
IB Math AA · Geometry and Trigonometry
Vectors, magnitude and the scalar product
For $\mathbf{v}=\begin{pmatrix}x\\y\\z\end{pmatrix}$, $|\mathbf{v}|=\sqrt{x^{2}+y^{2}+z^{2}}$, and the unit vector in that direction is $\dfrac{\mathbf{v}}{|\mathbf{v}|}$. If $A$ and $B$ have position vectors $\mathbf{a}$ and $\mathbf{b}$ then $\overrightarrow{AB}=\mathbf{b}-\mathbf{a}$.
$$\mathbf{u}\cdot\mathbf{v}=u_1v_1+u_2v_2+u_3v_3=|\mathbf{u}||\mathbf{v}|\cos\theta$$Hence $\mathbf{u}\cdot\mathbf{v}=0$ exactly when the two vectors are perpendicular, and a negative scalar product means an obtuse angle. The scalar product is a number, never a vector.
The vector equation of a line
$$\mathbf{r}=\mathbf{a}+\lambda\mathbf{b}$$where $\mathbf{a}$ is the position vector of one point on the line and $\mathbf{b}$ is a direction vector. Neither is unique: any point of the line and any non-zero multiple of $\mathbf{b}$ give the same line.
Two lines in space
Two lines in three dimensions are parallel if their direction vectors are multiples of one another; otherwise they either intersect or are skew. To decide, set the two position expressions equal. This gives three equations in two unknowns: solve two of them, then substitute into the third. If the third fails, the lines are skew.
The acute angle between two lines is found from the directions, using $\cos\theta=\dfrac{\left|\mathbf{b}_1\cdot\mathbf{b}_2\right|}{|\mathbf{b}_1||\mathbf{b}_2|}$ — the modulus signs are what force the answer to be acute.
Worked example: shortest distance from a point to a line
Given the line $L:\ \mathbf{r}=\begin{pmatrix}1\\2\\3\end{pmatrix}+\lambda\begin{pmatrix}2\\-1\\2\end{pmatrix}$ and the point $P(4,4,4)$. Find the point $F$ on $L$ closest to $P$, and the distance from $P$ to $L$.
Solution
Write $F$ in terms of one unknown. Every point of $L$ has the form
$$F=\begin{pmatrix}1+2\lambda\\2-\lambda\\3+2\lambda\end{pmatrix}\;\Longrightarrow\;\overrightarrow{PF}=\begin{pmatrix}2\lambda-3\\-\lambda-2\\2\lambda-1\end{pmatrix}$$Apply the perpendicularity condition. $F$ is closest to $P$ when $\overrightarrow{PF}$ is perpendicular to the direction vector:
$$2\left(2\lambda-3\right)+(-1)\left(-\lambda-2\right)+2\left(2\lambda-1\right)=0$$$$4\lambda-6+\lambda+2+4\lambda-2=0\;\Longrightarrow\;9\lambda-6=0\;\Longrightarrow\;\lambda=\frac23$$Coordinates and distance.
$$F=\left(\frac73,\ \frac43,\ \frac{13}{3}\right),\qquad \overrightarrow{PF}=\frac13\begin{pmatrix}-5\\-8\\1\end{pmatrix}$$$$\left|\overrightarrow{PF}\right|=\frac13\sqrt{25+64+1}=\frac{\sqrt{90}}{3}=\sqrt{10}\approx 3.162$$Quick check: the point $A(1,2,3)$ lies on $L$ and $\left|\overrightarrow{AP}\right|=\sqrt{9+4+1}=\sqrt{14}\approx 3.742$. The distance to the line must be smaller than the distance to any point on it — $3.162<3.742$, reasonable.
Worked example: intersecting or skew
Given $L_1:\ \mathbf{r}=\begin{pmatrix}1\\2\\3\end{pmatrix}+\lambda\begin{pmatrix}1\\0\\-1\end{pmatrix}$ and $L_2:\ \mathbf{r}=\begin{pmatrix}2\\0\\1\end{pmatrix}+\mu\begin{pmatrix}0\\1\\1\end{pmatrix}$. Are these two lines intersecting, parallel or skew? Find the acute angle between them.
Solution
Step 1 — are they parallel? $\begin{pmatrix}1\\0\\-1\end{pmatrix}$ is not a multiple of $\begin{pmatrix}0\\1\\1\end{pmatrix}$ (the first component would force the factor to be infinite), so the two lines are not parallel.
Step 2 — set the two positions equal, giving three equations.
$$1+\lambda=2\quad(1)\qquad 2=\mu\quad(2)\qquad 3-\lambda=1+\mu\quad(3)$$From $(1)$: $\lambda=1$. From $(2)$: $\mu=2$.
Step 3 — substitute into the remaining equation. This is the decisive step:
$$3-1=2\qquad\text{but}\qquad 1+2=3$$The left side gives $2$, the right side gives $3$: equation $(3)$ is not satisfied. The two lines neither intersect nor are parallel, so they are skew.
The acute angle between the two lines. Even though they are skew, the angle can still be computed from the two direction vectors:
$$\cos\theta=\frac{\left|1(0)+0(1)+(-1)(1)\right|}{\sqrt{2}\cdot\sqrt{2}}=\frac{1}{2}\;\Longrightarrow\;\theta=60^{\circ}$$Without the absolute value sign, $\cos\theta=-\dfrac12$ and $\theta=120^{\circ}$ — correct for two vectors, wrong for two lines.