In geometry, if you need to calculate the distance of a point from any given line, identify the shortest distance that rests between the line and the given point. In general, you can draw an infinite number of straight lines from a point onto a line lying in the plane.
Now, how can you determine the distance the rests between the line from this given point? You can do so by finding the shortest distance between this given point to the line.
How do you find the shortest distance from a point to a line? You can do this by drawing a perpendicular line on the given straight line that needs to pass through the given point.
Calculating the Distance Formula from a Point to a Line
As already highlighted, the shortest distance will give you the distance from the point to the line. This is the minimum length or distance that is required to move from the point onto the line. How do you calculate it?
Start with a triangle. A right-angled triangle is the best way to determine the shortest distance from a point to the given line. A longer distance here will be the hypotenuse of the right-angled triangle, while the perpendicular gives the distance. By joining these two lines, you will get another line segment that completes the entire right-angled triangle.
Calculating the Perpendicular Distance of a Point to a Line
Now that you know how to form the triangle, let us derive the formula for the perpendicular to determine the distance of the point from a line.
Let’s consider a straight line whose equation is given below:
L: Ax + By + C = 0 from a given point P (x1, y1)
Let us assume that the distance of this line from the point P is ‘d’.
Start by drawing a perpendicular from P to M on the line L. Let Q and R be the exact points where this line PM meets the x-axis and y-axis, respectively. Here, the coordinates of the points are
Q (-C/A, 0)
R (0, -C/B)
Deriving the Distance of the Point from a Given Line
Now that you have successfully created the right-angled triangle PQR, let’s derive the distance formula using the triangle’s area formula:
Area of ΔPQR = Half of Base x Height = Half of (PM x QR)
Therefore, PM = [2 area of (ΔPQR)]/2….(1)
According to the coordinate geometry,
The triangle’s area with the vertices (x1, y1), (x2, y2) and (x3, y3) = (1/2) |x1(y2 – y3) + x2(y3 – y1) + x3(y1 – y2)|
Therefore, (x1, y1) is equal to P(x1, y1)
(x2, y2) is equal to Q (-C/A, 0)
(x3, y3) is equal to R (0, -C/B)
So, the area of PQR = (1/2) | x 1(0 + C/B) + (-C/A)(-C/B – y1) + 0(y1 – 0)|
Or 2 times the area of PQR = |C/AB| . |Ax1 + By1 + C|….(2)
Distance of QR = √[(0 + C/A)2 + (C/B – 0)2] = √[(C2/A2) + (C2/B2)]
So, finding the value of QR will give the distance formula.
Here, QR = |C/AB| √(A2 + B2)….(3)
Substituting (2) and (3) in (1),
PM = [|C/AB| x |Ax1 + By1 + C|] / [|C/AB| √(A2 + B2)]
d = |Ax1 + By1 + C|]/ √(A2 + B2)
So, the perpendicular distance of the line L: Ax + By + C = 0 from the given point P (x1, y1) is
d = |Ax1 + By1 + C|]/ √(A2 + B2)
Let’s go through a few examples to understand how to use the distance formula to calculate the length from a given point to a straight line.
Examples
A couple of examples have been provided for a better understanding of how to calculate the distance from a point to a line.
Example 1:
How do you calculate the distance of point Q (-6,10) from the line 8x – 6y – 52 = 0?
Solution
The given equation of the line is 8x – 6y – 52 = 0.
The given point is Q (-6,10).
Comparing these two with the standard points,
A = 8
B = -6
C = -52
x1 = -6
y1 = 10
You already know that the perpendicular distance from a line like Ax + By+ C = 0 from a given line point (x1, y1) is given by
d = |Ax1 + By1 + C|]/ √(A2 + B2)
Substituting the values accordingly,
d = |8(-6) + (-6)(10) + (-52)|/√[(8)2 + (-6)2]
= |-48 – 60 – 52|/√(64 + 36)
= |-160|/√100
= 160/10
= 16 units
Hence, the required distance of Q (-6,10) from the line 8x – 6y – 52 = 0 is 16 units.
Example 2:
Calculate the length from P (5,1) and the straight line y = 3x + 1.
Solution
The given point P (5,1) and the straight line y = 3x + 1, i.e. 3x + 1 – y = 0
To find the distance between the line and P, let’s compare the values with the standard distance formula. To substitute,
A = 3, B = -1, C = 1
x1 = 5, y1 = 1
So, the perpendicular distance from the point (x1, y1) to the line Ax + By+ C = 0 is:
d = |Ax1 + By1 + C|]/ √(A2 + B2)
To substitute the values, you will get the distance from the point to the line:
d = [|3.5 + (-1)(1) + 1|]/√(32 + (-1)2)
d = 15/√10
So, the length from P (5,1) and the straight line y = 3x + 1 is 15/√10 units.
Conclusion:
This article explains the distance formula from point to the line. The shortest distance is the distance from the point to the line. This is the minimum length or distance that is required to move from the point onto the line. Using the Pythagorean theorem, you can derive the distance formula from any point to a line, which is:
d = √((x2 – x1)² + (y2 – y1)²)