Finding the distance from a point to a line is easy if the line is vertical or horizontal. We simply find the difference between the appropriate coordinates of the point and the line. In fact, for vertical lines, this is the only way to do it, since the other methods require the slope of the line, which is undefined for vertical lines. For more on this see Slope of a line (Coordinate Geometry)
In the figure above, click on 'reset'. As you can see we have a vertical line whose equation is x=22. This means that all points of the line have an x-coordinate of 22. The given point C has coordinates of (42,7) which means it has a x-coordinate of 42. The distance between the point and line is therefore the difference between 22 and 42, or 20.
As a formula:distance = | P_{x} - L_{x} | | |
where: | |
P_{x} | is the x-coordinate of the given point P |
L_{x} | is the x-coordinate of any point on the given vertical line L. |
| | | the vertical bars mean "absolute value" - make it positive even if it calculates to a negative. |
In the figure above, click on 'reset', then 'horizontal'. As you can see we have a horizontal line whose equation is y=25. This means that all points of the line have a y-coordinate of 25. The given point C has coordinates of (39,7) which means it has a y-coordinate of 7. The distance between the point and line is therefore the difference between 25 and 7, or 18.
As a formula:distance = | P_{y} - L_{y} | | |
where: | |
P_{y} | is the y-coordinate of the given point P |
L_{y} | is the y-coordinate of any point on the given vertical line L. |
| | | the vertical bars mean "absolute value" - make it positive even if it calculates to a negative. |
In the interest of clarity in the applet above, the coordinates are rounded off to integers and the lengths rounded to one decimal place. This can cause calculatioons to be slightly off.
For more see Teaching Notes