Overview
On this page, we discuss projections and how to use them to find the shortest distance between a point and a line or a plane (in 3dimensional space).
Note: The basic and advanced learning objectives listed below are meant to give you an idea of the material you should learn about this section. These are mainly intended to be used in a course which uses an Active Learning approach, where students are required to "read ahead" before each class  but can equally be used in a more traditional course setting.
Unless your teacher gives you specific instructions, it is up to you to decide how much of the listed resources you need to read or watch  you probably do not need to go through all of it. You might also want to look at the General Study Tips & Tricks page for some recommendations on how to effectively study with a math textbook and videos.
Basic learning objectives
These are the tasks you should be able to perform with reasonable fluency when you arrive at your next class meeting. Important new vocabulary words are indicated in italics.

Compute the vector component of \(\vec{u}\) along \(\vec{a}\) and orthogonal to \(\vec{a}\).

Find the distance between a point and a line in \(\mathbb{R}^2\) using the formula.

Find the distance between a point and a plane using the formula.
Advanced learning objectives
In addition to mastering the basic objectives, here are the tasks you should be able to perform after class, with practice:

Find the distance between a point and a line in \(\mathbb{R}^2\), using projection.

Find the distance between a point and a plane using projection.

Find the distance between two parallel planes in \(\mathbb{R}^3\).

Prove results related to orthogonality.
To prepare for class
Projections

Watch these two videos which explain how to find the projection of a vector onto a line:
Distance from a point to a plane
Note: Many textbooks will show you a specific formula to memorize for this. I highly recommend that you do not memorize or use this formula, as it only works under specific situations. It is much better to understand the concept behind the formula, which is to use a certain projection vector and measure its length:

Watch this video which explains how to find the distance from a point to a plane, using a projection onto the normal vector:
Distance from a point to a line
Note: Just as in the case of a plane, many textbooks will show a formula to memorize for this. This formula will only work in \(\mathbb{R}^2\) and will fail in general. Therefore, it is much better to properly understand the concept of using projections:
Method using projections (recommended)
The following recommended method not only enables us to find the shortest distance between a point and a line, but also the point in the line at which this shortest distance is realized:
Goal: Find the shortest distance from the given point \(P\) to a given line.
Solution:
 We need to know a point \(A\) inside the line, and a vector \(\vec{v}\) giving the direction of the line. If the line is given in parametric form \(\vec{OX}=\vec{OA}+t\vec{v}\), this information can be directly read off.
 Construct the vector \(\vec{w}=\vec{AP}\).
 Construct the projection of \(\vec{w}\) onto the line given by \(\vec{v}\), call it \(\vec{w}_{\parallel}=\text{proj}_{\vec{v}} \vec{w}\) (this is the "vector component of \(\vec{w}\) parallel to \(\vec{v}\)").
 (Optional) If you want to know the coordinates of the point \(C\) on the line which is closest to \(P\), its coordinates are given by \(\vec{OC}=\vec{OA}+\vec{AC}=\vec{OA}+\vec{w}_{\parallel}\).
 Find the "vector component of \(\vec{w}\) orthogonal to \(\vec{v}\)", \(\vec{w}_{\perp}=\vec{w}\vec{w}_{\parallel}\).
 The length of \(\vec{w}_{\perp}\) is the wanted distance, so simply calculate its magnitude.
Alternative method using the crossproduct
It turns out that there is an alternative (and slightly quicker) method for finding the shortest distance from a point to a line, using the crossproduct. But this method has the big disadvantage that it does not directly give us the point on the line which realizes the shortest distance  and in most applications, that's actually what we are most interested in! Another disadvantage of this method is that it only works in 3space (since the crossproduct is not defined in other dimensions)  but the method using projections actually works in any \(n\)dimensional space (\(n\geq 2\))!
All this being said, it's still a useful method to know about:

Watch these two videos which explain how to find the distance of a point from a line by using the crossproduct (note that he uses the "determinantmethod" to calculate the crossproduct, which you may or may not have seen yet in your class  simply use whatever method you have learned):