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.

P F A b r = a + λb shortest distance F is the point on the line for some λ. Condition that determines F: (F − P) · b = 0 — a linear equation in one unknown λ. Every other point on the line is farther from P than F: PF is a leg, the other segments are hypotenuses.
The shortest-distance problem is just one linear equation. The point $F$ moves along the line so it has the form $\mathbf{a}+\lambda\mathbf{b}$ with exactly one unknown $\lambda$. The condition $\overrightarrow{PF}\cdot\mathbf{b}=0$ gives a linear equation in $\lambda$; once solved you have $F$, and the distance is $\left|\overrightarrow{PF}\right|$. The figure also explains why this is the shortest distance: for any other point $G$ on the line, triangle $PFG$ is right-angled at $F$ so $PG$ is the hypotenuse and is always longer than $PF$. A common mistake: using $\left|\overrightarrow{AP}\right|$ straight away as the answer — that is the distance to one specific point of the line, not to the line, and it is always greater than or equal to the correct answer.

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.

Common mistake

Concluding that two lines intersect after solving the first two equations. The exact mechanism is what makes this trap almost impossible to detect yourself: setting the two positions equal produces three equations but only two unknowns $\lambda$ and $\mu$. The first two equations can almost always be solved and give a neat pair of numbers; the student sees "solved" and stops, substitutes $\lambda$ into $L_1$, and submits a perfectly concrete point. That point is real — it lies on $L_1$ — it just does not lie on $L_2$. In three dimensions, two non-parallel lines are usually skew; intersecting is the special case, and a system of three equations in two unknowns is exactly the way to measure that specialness. A self-protecting habit: after finding $\lambda$ and $\mu$, compute the coordinates of the point on $L_1$ and the coordinates of the point on $L_2$ separately, then compare component by component — if all three components match the lines intersect, if one component is off they are skew.

Key takeaway

The scalar product is the only bridge between vector algebra and the geometry of angles: perpendicularity, the angle between, projection and shortest distance all reduce to it. With two lines, always remember two things — the absolute value sign when computing the angle, and the third equation when testing for intersection.

← The unit circle, identities and trigonometric equations · All IB Math AA lessons · Practice IB Math AA questions (free, instant scoring) · Descriptive statistics, outliers and linear transformations →