# Shortest distance between a point and a line

## Distance between point & line The distance (or perpendicular distance) from a point to a line is the shortest distance from a fixed point to any point on a fixed infinite line in Euclidean geometry.

and

If you're seeing this message, it means we're having trouble loading external resources on our website. To log in and use all the features of Khan Academy, please enable JavaScript in your browser. Math Geometry all content Analytic geometry Challenge: Distance between a point and a line. Current timeTotal duration Video transcript Find the distance between the point negative 2, negative 4. This point right here. That's this line right over here.

By using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service. Setup a private space for you and your coworkers to ask questions and share information. I need a basic function to find the shortest distance between a point and a line segment. Feel free to write the solution in any language you want; I can translate it into what I'm using Javascript. EDIT: My line segment is defined by two endpoints.

How can you find the distance between two objects say two street lights? By measuring the length between them. By the length between the two street lights, we can find the distance. We have to measure the length between the two. Similarly, for finding the distance between two points, we measure the length between them. Here, we will study how to find the distance of point from a line. We are familiar with the representation of points on a graph sheet.

The equation of a line in slope-intercept form is given by. Now consider the distance from a point to the line. Points on the line have the vector coordinates. Now, a vector from the point to the line is given by. Projecting onto ,. If the line is specified by two points and , then a vector perpendicular to the line is given by.

The distance or perpendicular distance from a point to a line is the shortest distance from a fixed point to any point on a fixed infinite line in Euclidean geometry. It is the length of the line segment which joins the point to the line and is perpendicular to the line. The formula for calculating it can be derived and expressed in several ways. Knowing the shortest distance from a point to a line can be useful in various situations—for example, finding the shortest distance to reach a road, quantifying the scatter on a graph, etc. In Deming regression , a type of linear curve fitting, if the dependent and independent variables have equal variance this results in orthogonal regression in which the degree of imperfection of the fit is measured for each data point as the perpendicular distance of the point from the regression line.

## Perpendicular Distance from a Point to a Line

1. Myra S. says: