The distance between a point and a straight line is the minimum of the distances between and any point on the straight line.
We can distinguish two cases:
- If belongs to the straight line , .
- If does not belong to the straight line , , it is the module of the vector , where is the intersection point between the straight line and the perpendicular to that crosses .
Let be the general equation of the straight line , and the given point and any point of the straight line.
If we take a perpendicular vector to , for example for the properties of the scalar product in the vectors projection we have:
But since is a point of the straight line , it verifies its equation:
Therefore we obtain the following formula:
Example
Let be a point and a straight line. Calculate the distance between the point and the straight line.
Applying the previous formula we have: