Distance from a Point to a Line on a Plane
The distance from a point M(x0, y0) to a straight line Ax + By + C = 0 in the plane is determined by the formula
Here (x0, y0) is the coordinate of the point M and A, B, C are the coefficients of the equation of the straight line.
This formula calculates the perpendicular distance d = MN between the point and the line. The formula can be proved as follows.
Proof
Let point N(x1, y1) be the foot of the perpendicular drawn from the point M(x0, y0) to the line Ax + By + C = 0. Find the slope of the line Ax + By + C = 0:
Therefore, the slope is equal to \(k = -\frac{A}{B}.\)
Since the lines MN and Ax + By + C = 0 are perpendicular, the slope of line MN is equal to
Hence the equation of the straight line MN has the form
Find now the value of BMN. Since point M(x0, y0) belongs to this line, then its coordinates satisfy the equation:
So
Point N(x1, y1) also belongs to the line MN, so its coordinates also satisfy this equation:
From here we get
We denote
Then
The distance between points M and N is determined by the formula
Therefore
Notice, that
Taking into account that the point N(x1, y1) lies on the line Ax + By + C = 0, we obtain
Find the value of q from this equation:
Substituting the value of \(q\) into the formula for the distance, we get
Using some algebra we get the final expression:
Solved Problems
Example 1.
Find the distance from the origin to the straight line \({6x - 8y + 5 = 0}.\)
Solution.
The distance from a point M(x0, y0) to the line Ax + By + C = 0 is determined by the formula
Substitute the coordinates of the origin O(0,0) and the coefficients of the line:
Example 2.
Find the length of the altitude \(BD\) in a triangle with vertices \({A\left({-3,0}\right)},\) \({B\left({2,5}\right)},\) and \({C\left({3,2}\right)}.\)
Solution.
Write the equation of the line \(AC\) in two-point form:
and convert it into the general form:
Calculate now the distance from point \(B\) to line \(AC,\) that is, the length of the segment \(BD:\)
Example 3.
Find the distance between two parallel lines \(Ax + By + C_1 = 0\) and \(Ax + By + C_2 = 0.\)
Solution.
Let the point \(M\left({x_0,y_0}\right)\) belong to the line \(Ax + By + C_1 = 0.\) The distance from point M to the straight line \(Ax + By + C_2 = 0\) is given by
Since the point M belongs to the first line, we have
Substituting this into the previous expression, we get
Example 4.
A line drawn through the origin at the same distance from points \(M\left({3,3}\right)\) and \(N\left({5,1}\right).\) Find the equation of this line.
Solution.
Since the line passes through the origin, its equation is \(Ax + By = 0.\) The distances from points M and N to the line are equal, therefore
Expanding the absolute values, we get two solutions (two straight lines):
Find the equation of the first line:
The equation of the second straight line is written as
The location of these lines is shown in the figure below.