Option A.

## Distance from a point to a line

In Euclidean geometry, the ‘distance from a point to a line is the shortest distance from a given point to any point on an infinite straight line. It is the perpendicular distance of the point to the line, the length of the line segment which joins the point to nearest point on the line. The formula for calculating it can be derived and expressed in several ways.

Knowing the 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.

## Line defined by an equation

In the case of a line in the plane given by the equation ax + by + c = 0, where a, b and c are real constants with a and b not both zero, the distance from the line to a point (x0, y0) is

$\displaystyle \operatorname distance (ax+by+c=0,(x_0,y_0))=\frac \sqrt a^2+b^2.$

distance

(
a
x
+
b
y
+
c
=
0
,
(

x

0

,

y

0

)
)
=

|

a

x

0

+
b

y

0

+
c

|

a

2

+

b

2

.

{\displaystyle \operatorname distance (ax+by+c=0,(x_0,y_0))=\frac \sqrt a^2+b^2.}

The point on this line which is closest to (x0, y0) has coordinates:

$\displaystyle x=\frac b(bx_0-ay_0)-aca^2+b^2\text and y=\frac a(-bx_0+ay_0)-bca^2+b^2.$

x
=

b
(
b

x

0

a

y

0

)

a
c

a

2

+

b

2

and

y
=

a
(

b

x

0

+
a

y

0

)

b
c

a

2

+

b

2

.

\displaystyle x=\frac b(bx_0-ay_0)-aca^2+b^2\text and y=\frac a(-bx_0+ay_0)-bca^2+b^2.

Horizontal and vertical lines

In the general equation of a line, ax + by + c = 0, a and b cannot both be zero unless c is also zero, in which case the equation does not define a line. If a = 0 and b ≠ 0, the line is horizontal and has equation y = −c/b. The distance from (x0, y0) to this line is measured along a vertical line segment of length |y0 − (−c/b)| = |by0 + c|/|b| in accordance with the formula. Similarly, for vertical lines (b = 0) the distance between the same point and the line is |ax0 + c|/|a|, as measured along a horizontal line segment.

## Line defined by two points

If the line passes through two points P1 = (x1, y1) and P2 = (x2, y2) then the distance of (x0, y0) from the line is:

${\displaystyle \operatorname distance (P_1,P_2,(x_0,y_0))=\frac \sqrt (x_2-x_1)^2+(y_2-y_1)^2.}$

distance

(

P

1

,

P

2

,
(

x

0

,

y

0

)
)
=

|

(

x

2

x

1

)
(

y

1

y

0

)

(

x

1

x

0

)
(

y

2

y

1

)

|

(

x

2

x

1

)

2

+
(

y

2

y

1

)

2

.

{\displaystyle \operatorname distance (P_1,P_2,(x_0,y_0))=\frac (x_2-x_1)(y_1-y_0)-(x_1-x_0)(y_2-y_1)\sqrt (x_2-x_1)^2+(y_2-y_1)^2.}

The denominator of this expression is the distance between P1 and P2. The numerator is twice the area of the triangle with its vertices at the three points, (x0, y0), P1 and P2. See: Area of a triangle § Using coordinates. The expression is equivalent to h = 2A/b, which can be obtained by rearranging the standard formula for the area of a triangle: A = 1/2 bh, where b is the length of a side, and h is the perpendicular height from the opposite vertex.

## Line defined by point and angle

If the line passes through the point P = (Px, Py) with angle θ, then the distance of some point (x0, y0) to the line is

$\displaystyle \operatorname distance (P,\theta ,(x_0,y_0))=$

distance

(
P
,
θ
,
(

x

0

,

y

0

)
)
=

|

cos

(
θ
)
(

P

y

y

0

)

sin

(
θ
)
(

P

x

x

0

)

|

\cos(\theta )(P_y-y_0)-\sin(\theta )(P_x-x_0)

## Proofs

### An algebraic proof

This proof is valid only if the line is neither vertical nor horizontal, that is, we assume that neither a nor b in the equation of the line is zero.

The line with equation ax + by + c = 0 has slope a/b, so any line perpendicular to it will have slope b/a (the negative reciprocal). Let (m, n) be the point of intersection of the line ax + by + c = 0 and the line perpendicular to it which passes through the point (x0, y0). The line through these two points is perpendicular to the original line, so

$\displaystyle \frac y_0-nx_0-m=\frac ba.$

y

0

n

x

0

m

=

b
a

.

\displaystyle \frac y_0-nx_0-m=\frac ba.

Thus,

$\displaystyle a(y_0-n)-b(x_0-m)=0,$

a
(

y

0

n
)

b
(

x

0

m
)
=
0
,

\displaystyle a(y_0-n)-b(x_0-m)=0,

and by squaring this equation we obtain:

$\displaystyle a^2(y_0-n)^2+b^2(x_0-m)^2=2ab(y_0-n)(x_0-m).$

a

2

(

y

0

n

)

2

+

b

2

(

x

0

m

)

2

=
2
a
b
(

y

0

n
)
(

x

0

m
)
.

\displaystyle a^2(y_0-n)^2+b^2(x_0-m)^2=2ab(y_0-n)(x_0-m).

Now consider,

\displaystyle \beginaligned(a(x_0-m)+b(y_0-n))^2&=a^2(x_0-m)^2+2ab(y_0-n)(x_0-m)+b^2(y_0-n)^2\\&=\left(a^2+b^2\right)\left((x_0-m)^2+(y_0-n)^2\right)\endaligned

(
a
(

x

0

m
)
+
b
(

y

0

n
)

)

2

=

a

2

(

x

0

m

)

2

+
2
a
b
(

y

0

n
)
(

x

0

m
)
+

b

2

(

y

0

n

)

2

=

(

a

2

+

b

2

)

(

(

x

0

m

)

2

+
(

y

0

n

)

2

)

\displaystyle \beginaligned(a(x_0-m)+b(y_0-n))^2&=a^2(x_0-m)^2+2ab(y_0-n)(x_0-m)+b^2(y_0-n)^2\\&=\left(a^2+b^2\right)\left((x_0-m)^2+(y_0-n)^2\right)\endaligned

using the above squared equation. But we also have,

$\displaystyle (a(x_0-m)+b(y_0-n))^2=(ax_0+by_0-am-bn)^2=(ax_0+by_0+c)^2$

(
a
(

x

0

m
)
+
b
(

y

0

n
)

)

2

=
(
a

x

0

+
b

y

0

a
m

b
n

)

2

=
(
a

x

0

+
b

y

0

+
c

)

2

\displaystyle (a(x_0-m)+b(y_0-n))^2=(ax_0+by_0-am-bn)^2=(ax_0+by_0+c)^2

since (m, n) is on ax + by + c = 0.
Thus,

$\displaystyle \left(a^2+b^2\right)\left((x_0-m)^2+(y_0-n)^2\right)=(ax_0+by_0+c)^2$

(

a

2

+

b

2

)

(

(

x

0

m

)

2

+
(

y

0

n

)

2

)

=
(
a

x

0

+
b

y

0

+
c

)

2

\displaystyle \left(a^2+b^2\right)\left((x_0-m)^2+(y_0-n)^2\right)=(ax_0+by_0+c)^2

and we obtain the length of the line segment determined by these two points,

${\displaystyle d=\sqrt (x_0-m)^2+(y_0-n)^2=\frac \sqrt a^2+b^2.}$

d
=

(

x

0

m

)

2

+
(

y

0

n

)

2

=

|

a

x

0

+
b

y

0

+
c

|

a

2

+

b

2

.

{\displaystyle d=\sqrt (x_0-m)^2+(y_0-n)^2=\frac \sqrt a^2+b^2.}

### A geometric proof

Diagram for geometric proof

This proof is valid only if the line is not horizontal or vertical.

Drop a perpendicular from the point P with coordinates (x0, y0) to the line with equation Ax + By + C = 0. Label the foot of the perpendicular R. Draw the vertical line through P and label its intersection with the given line S. At any point T on the line, draw a right triangle TVU whose sides are horizontal and vertical line segments with hypotenuse TU on the given line and horizontal side of length |B| (see diagram). The vertical side of ∆TVU will have length |A| since the line has slope –A/B.

PRS and ∆TVU are similar triangles, since they are both right triangles and ∠PSR ≅ ∠TUV since they are corresponding angles of a transversal to the parallel lines PS and UV (both are vertical lines). Corresponding sides of these triangles are in the same ratio, so:

${\displaystyle \frac \overline PR\overline PS=\frac \overline TU.}$

|

P
R

¯

|

|

P
S

¯

|

=

|

T
V

¯

|

|

T
U

¯

|

.

{\displaystyle \frac =\frac .}

If point S has coordinates (x0,m) then |PS| = |y0m| and the distance from P to the line is:

${\displaystyle |\overline PR|=\frac \sqrt A^2+B^2.}$

|

P
R

¯

|

=

|

y

0

m

|

|

B

|

A

2

+

B

2

.

{\displaystyle |\overline PR|=\frac \sqrt A^2+B^2.}

Since S is on the line, we can find the value of m,

$\displaystyle m=\frac -Ax_0-CB,$

m
=

A

x

0

C

B

,

\displaystyle m=\frac -Ax_0-CB,

and finally obtain:

${\displaystyle |\overline PR|=\frac \sqrt A^2+B^2.}$

|

P
R

¯

|

=

|

A

x

0

+
B

y

0

+
C

|

A

2

+

B

2

.

{\displaystyle |\overline PR|=\frac \sqrt A^2+B^2.}

A variation of this proof is to place V at P and compute the area of the triangle ∆UVT two ways to obtain that



D

|

T
U

¯

|

=

|

V
U

¯

|

|

V
T

¯

|

\overline VU

where D is the altitude of ∆UVT drawn to the hypotenuse of ∆UVT from P. The distance formula can then used to express

$\displaystyle$

|

T
U

¯

|

\overline TU

,

$\overline VU$

|

V
U

¯

|

\displaystyle

, and

$\overline VT$

|

V
T

¯

|

in terms of the coordinates of P and the coefficients of the equation of the line to get the indicated formula.[citation needed]

### A vector projection proof

Let P be the point with coordinates (x0, y0) and let the given line have equation ax + by + c = 0. Also, let Q = (x1, y1) be any point on this line and n the vector (a, b) starting at point Q. The vector n is perpendicular to the line, and the distance d from point P to the line is equal to the length of the orthogonal projection of

$\displaystyle \overrightarrow QP$

Q
P

\displaystyle \overrightarrow QP

on n. The length of this projection is given by:

${\displaystyle d=\frac \overrightarrow QP\cdot \mathbf n \mathbf n \.}$

d
=

|

Q
P

n

|

n

.

\displaystyle d=\frac \.

Now,

$\displaystyle \overrightarrow QP=(x_0-x_1,y_0-y_1),$

Q
P

=
(

x

0

x

1

,

y

0

y

1

)
,

\displaystyle \overrightarrow QP=(x_0-x_1,y_0-y_1),

so

$\displaystyle \overrightarrow QP\cdot \mathbf n =a(x_0-x_1)+b(y_0-y_1)$

Q
P

n

=
a
(

x

0

x

1

)
+
b
(

y

0

y

1

)

\displaystyle \overrightarrow QP\cdot \mathbf n =a(x_0-x_1)+b(y_0-y_1)

and

$\displaystyle \$

n

=

a

2

+

b

2

,

\displaystyle \

thus

${\displaystyle d=\frac a(x_0-x_1)+b(y_0-y_1)\sqrt a^2+b^2.}$

d
=

|

a
(

x

0

x

1

)
+
b
(

y

0

y

1

)

|

a

2

+

b

2

.

{\displaystyle d=\frac \sqrt a^2+b^2.}

Since Q is a point on the line,

$\displaystyle c=-ax_1-by_1$

c
=

a

x

1

b

y

1

\displaystyle c=-ax_1-by_1

, and so,

${\displaystyle d=\frac \sqrt a^2+b^2.}$

d
=

|

a

x

0

+
b

y

0

+
c

|

a

2

+

b

2

.

{\displaystyle d=\frac \sqrt a^2+b^2.}

Although the distance is given as a modulus, the sign can be useful to determine which side of the line the point is on, in a sense determined by the direction of normal vector (a,b)

## Another formula

It is possible to produce another expression to find the shortest distance of a point to a line. This derivation also requires that the line is not vertical or horizontal.

The point P is given with coordinates (

$\displaystyle x_0,y_0$

x

0

,

y

0

\displaystyle x_0,y_0

).
The equation of a line is given by

$\displaystyle y=mx+k$

y
=
m
x
+
k

\displaystyle y=mx+k

. The equation of the normal of that line which passes through the point P is given

$\displaystyle y=\frac x_0-xm+y_0$

y
=

x

0

x

m

+

y

0

\displaystyle y=\frac x_0-xm+y_0

.

The point at which these two lines intersect is the closest point on the original line to the point P. Hence:

$\displaystyle mx+k=\frac x_0-xm+y_0.$

m
x
+
k
=

x

0

x

m

+

y

0

.

\displaystyle mx+k=\frac x_0-xm+y_0.

We can solve this equation for x,

$\displaystyle x=\frac x_0+my_0-mkm^2+1.$

x
=

x

0

+
m

y

0

m
k

m

2

+
1

.

\displaystyle x=\frac x_0+my_0-mkm^2+1.

The y coordinate of the point of intersection can be found by substituting this value of x into the equation of the original line,

$\displaystyle y=m\frac (x_0+my_0-mk)m^2+1+k.$

y
=
m

(

x

0

+
m

y

0

m
k
)

m

2

+
1

+
k
.

\displaystyle y=m\frac (x_0+my_0-mk)m^2+1+k.

Using the equation for finding the distance between 2 points,

$\displaystyle d=\sqrt (X_2-X_1)^2+(Y_2-Y_1)^2$

d
=

(

X

2

X

1

)

2

+
(

Y

2

Y

1

)

2

\displaystyle d=\sqrt (X_2-X_1)^2+(Y_2-Y_1)^2

, we can deduce that the formula to find the shortest distance between a line and a point is the following:

${\displaystyle d={\sqrt {\left(\frac x_0+my_0-mkm^2+1-x_0\right)^2+\left(m\frac x_0+my_0-mkm^2+1+k-y_0\right)^2}}=\frac \sqrt 1+m^2.}$

d
=

(

x

0

+
m

y

0

m
k

m

2

+
1

x

0

)

2

+

(

m

x

0

+
m

y

0

m
k

m

2

+
1

+
k

y

0

)

2

=

|

k
+
m

x

0

y

0

|

1
+

m

2

.

{\displaystyle d={\sqrt {\left(\frac x_0+my_0-mkm^2+1-x_0\right)^2+\left(m\frac x_0+my_0-mkm^2+1+k-y_0\right)^2}}=\frac \sqrt 1+m^2.}

Recalling that m = –a/b and k = – c/b for the line with equation ax + by + c = 0, a little algebraic simplification reduces this to the standard expression.

## Vector formulation

Illustration of the vector formulation.

The equation of a line can be given in vector form:

$\displaystyle \mathbf x =\mathbf a +t\mathbf n$

x

=

a

+
t

n

\displaystyle \mathbf x =\mathbf a +t\mathbf n

Here a is a point on the line, and n is a unit vector in the direction of the line. Then as scalar t varies, x gives the locus of the line.

The distance of an arbitrary point p to this line is given by

$\displaystyle \operatorname distance (\mathbf x =\mathbf a +t\mathbf n ,\mathbf p )=\$

distance

(

x

=

a

+
t

n

,

p

)
=

(

p

a

)

(
(

p

a

)

n

)

n

.

.

This formula can be derived as follows:

$\displaystyle \mathbf p -\mathbf a$

p

a

\displaystyle \mathbf p -\mathbf a

is a vector from a to the point p. Then

$\displaystyle (\mathbf p -\mathbf a )\cdot \mathbf n$

(

p

a

)

n

\displaystyle (\mathbf p -\mathbf a )\cdot \mathbf n

is the projected length onto the line and so

$\displaystyle \mathbf a +((\mathbf p -\mathbf a )\cdot \mathbf n )\mathbf n$

a

+
(
(

p

a

)

n

)

n

\displaystyle \mathbf a +((\mathbf p -\mathbf a )\cdot \mathbf n )\mathbf n

is a vector that is the projection of

$\displaystyle \mathbf p -\mathbf a$

p

a

\displaystyle \mathbf p -\mathbf a

onto the line and represents the point on the line closest to

$\displaystyle \mathbf p$

p

\displaystyle \mathbf p

. Thus

$\displaystyle (\mathbf p -\mathbf a )-((\mathbf p -\mathbf a )\cdot \mathbf n )\mathbf n$

(

p

a

)

(
(

p

a

)

n

)

n

\displaystyle (\mathbf p -\mathbf a )-((\mathbf p -\mathbf a )\cdot \mathbf n )\mathbf n

is the component of

$\displaystyle \mathbf p -\mathbf a$

p

a

\displaystyle \mathbf p -\mathbf a

perpendicular to the line. The distance from the point to the line is then just the norm of that vector. This more general formula is not restricted to two dimensions.

## Another vector formulation

If the vector space is orthonormal and if the line goes through point a and has a direction vector n, the distance between point p and the line is

$\displaystyle \operatorname distance (\mathbf x =\mathbf a +t\mathbf n ,\mathbf p )=\frac (\mathbf p -\mathbf a )\times \mathbf n \right\\mathbf n \.$

distance

(

x

=

a

+
t

n

,

p

)
=

(

p

a

)
×

n

n

.

{\displaystyle \operatorname distance (\mathbf x =\mathbf a +t\mathbf n ,\mathbf p )=\frac \.}

Note that cross products only exist in dimensions 3 and 7.

## Video about Which Diagram Represents A Perpendicular Distance In Euclidean Geometry

Perpendicular Distance (1 of 2: Introduction to the Formula)

## Question about Which Diagram Represents A Perpendicular Distance In Euclidean Geometry

If you have any questions about Which Diagram Represents A Perpendicular Distance In Euclidean Geometry, please let us know, all your questions or suggestions will help us improve in the following articles!

The article Which Diagram Represents A Perpendicular Distance In Euclidean Geometry was compiled by me and my team from many sources. If you find the article Which Diagram Represents A Perpendicular Distance In Euclidean Geometry helpful to you, please support the team Like or Share!

Rate: 4-5 stars
Ratings: 3781
Views: 83217155

## Search keywords Which Diagram Represents A Perpendicular Distance In Euclidean Geometry

1. Point-Line Distance
2. Perpendicular Distance
3. Shortest Distance
4. Vector Projection
5. Line Segment
6. Vector Direction
7. Orthogonal Distance
8. Vector Magnitude
9. Vector Subtraction