Line between two point and perpendicular distance to third point.xls
Description
Purpose of calculation:
a) Find the equation of a line through two points.
b) Calculate the shortest distance between the line and a third point.
Calculation Reference
First principles and proof on http://math.ucsd.edu/~wgarner/math4c/derivations/distance/distptline.htm
Calculation Validation
Independent check and graphical check.
The following video describes how to use the spreadsheet. It is best viewed in fullscreen mode so you will have to double click the player.
</p>
Calculation Reference
Coordinate Geometry

To find the equation of the line passing through two given points and the perpendicular distance from a third point to this line, we can follow these steps:
 Find the equation of the line passing through the two given points using the pointslope form:
(y  y1) = ((y2  y1) / (x2  x1)) * (x  x1)
where (x1, y1) and (x2, y2) are the two given points.

Calculate the slope of the line perpendicular to this line. The slope of a line perpendicular to another line with slope m is 1/m.

Using the perpendicular distance formula, find the equation of the line that passes through the third point and is perpendicular to the line found in step 1. The perpendicular distance from a point (x3, y3) to a line with equation Ax + By + C = 0 is:
d = Ax3 + By3 + C / sqrt(A^2 + B^2)
So, the equation of the line passing through the third point and perpendicular to the line in step 1 is:
(y  y3) = (1 / ((y2  y1) / (x2  x1))) * (x  x3)
where ((y2  y1) / (x2  x1)) is the slope of the line found in step 1.
 Simplify the equation obtained in step 3 by multiplying both sides by ((y2  y1) / (x2  x1)) to get the equation in the form y = mx + b.
Now you have the equation of the line passing through the two given points and the perpendicular distance from the third point to this line.
Calculation Preview
Full download access to any calculation is available to users with a paid or awarded subscription (XLC Pro).
Subscriptions are free to contributors to the site, alternatively they can be purchased.
Click here for information on subscriptions.