How to Calculate the Distance Between Points & Lines
The shortest distance between two points is a straight line, and the shortest straight line between a point and a line is along the line that passes through the point and is perpendicular to the line. To determine the distance from a point to a line, you must generate the perpendicular and then measure the distance along that line. You can accomplish this operation either graphically or algebraically when the line is defined by its slope and intercept, and the point is defined by its X,Y coordinates.
Instructions
-
Graphic Method
-
1
Plot the point and line on a sheet of graph paper.
-
2
Open the compass to approximately twice the distance from the point to the line. Place the pivot of the compass on the point and swing an arc that intersects the line twice.
-
-
3
Place the pivot of the compass on one of the intersections without changing the gap in the compass. Swing an arc that covers about a quarter of a circle, starting at the line and extending in the direction opposite the point.
-
4
Repeat drawing the arc from the other intersection point on the line. The two arcs will cross on the side opposite the point.
-
5
Connect the original point and the intersection point with a straight line. This line is perpendicular to the original line and passes through the original point.
-
6
Measure the distance between the original point and original line along the constructed perpendicular.
Algebraic Method
-
7
Calculate the slope of a perpendicular from the point to the line, which is the negative reciprocal of the slope of the line. Example: the line has slope = ¾ and intercept = -2, so the perpendicular line has slope = -(4/3).
-
8
Calculate the intercept of the constructed perpendicular. Given the formula for a straight line, y = mx + b, where m = slope and b = intercept, the intercept of the perpendicular is equal to the y-coordinate of the point minus its x-coordinate times the line's slope. For example, given a point with X,Y coordinates of 3,8 and slope of -4/3; the intercept = 8-((-4/3) * 3) = 12.
-
9
Find the X-coordinate of the point in the original line that satisfies the equations of both lines. This requires solving simultaneous equations. Through substitution, you can determine that the X = (b1 -- b2) / (m2 -- m1), where m = slope, b = intercept, line 1 is the original line and line 2 is the perpendicular. Substitute the values of m1, m2, b1, and b2 to get the value of X = (-2-12) / (-1.33-.75) = (-14 / -2.08) = 6.73
-
10
Substitute the X value into line 1's formula (y = mx+b) to determine the Y value of the crossing point. Y = ¾ * 6.73 + (-2), or 3.05. The point at which the perpendicular crosses the original line has X.Y coordinates of 6.73, 3.05.
-
11
Calculate the difference in X and Y between the original point and the crossing point. Subtract the X of the second (crossing) point from the X of the original point; subtract the Y values in the same order. For the example,the X difference = 3 ? 6.73 = (-3.73); the Y difference = 8 ? 3.05 = 4.95.
-
12
Use the Pythagorean theorem (a² = b² + c²) to determine the length of the line from the original point to the crossing point, which is the hypotenuse (line c). In the example, the length of the hypotenuse is the square root of (-3.73)² + (4.95)², = square root of 13.91 + 24.50 = square root of 38.41, or 6.20 units.
-
1