Line between two point and perpendicular distance to third point.xls
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.
First principles and proof on http://math.ucsd.edu/~wgarner/math4c/derivations/distance/distptline.htm
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.
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 point-slope 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.
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.