# The distance of a point from a line

Vectors give us the tools to determine the distance of a point in space from a line in space.

A line in space passes through points A (2,1,3) and point B (0,2,1). Determine the distance of point C (1,1,1) from the line.

The shortest distance is always the perpendicular distance from the line. Let D be the point on the line closest to point C.

We set the vectors

The vector CD can be described by the vector CA and the direction vector a of the line.

In addition, the vector CD is perpendicular to the direction of the line of vector a. So the dot product of the vectors is 0

Vectors CA and line direction vector a between points A and B.

Now we can describe the vector CD using these vectors

The dot product of the vector CD and the vector a

The dot product has to be 0

So vector CD is

The distance of point C from the line is the length of the vector CD

The distance of point C from the line defined by points A and B is 1.

Turn on the subtitles if needed