Chapter 25: distance from a point to a line

點到直線距離

Theorem 25.1 {P=P(x0,y0)L=L(x,y)=Ax+By+C=0,A2+B20d(P,L)=|Ax0+By0+C|A2+B2

https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line

https://highscope.ch.ntu.edu.tw/wordpress/?p=47407

https://web.math.sinica.edu.tw/mathmedia/HTMLarticle18.jsp?mID=40312

Proofs:

25.1 by shortest ¯PP

P=P(x,y)L=Ax+By+C=0y=1B(Ax+C)

¯PP2(x,y)=(x0x)2+(y0y)2=(x0x)2+(y01B(Ax+C))2=(xx0)2+(ABx+CB+y0)2=¯PP2(x)

0=x¯PP2(x)=2(xx0)+2(ABx+CB+y0)AB=2B2(B2(xx0)+A2x+AC+ABy0)=2B2[(A2+B2)x(B2x0ABy0AC)]x=B2x0ABy0ACA2+B2 or by completing the square to find x.

¯PP2(x=B2x0ABy0ACA2+B2)=(B2x0ABy0ACA2+B2x0)2+(ABB2x0ABy0ACA2+B2+CB+y0)2=(A2x0ABy0ACA2+B2)2+(A(B2x0ABy0AC)+C(A2+B2)+B(A2+B2)y0B(A2+B2))2=(A(Ax0+By0+C)A2+B2)2+(AB2x0+B3y0+B2CB(A2+B2))2=A2(Ax0+By0+C)2(A2+B2)2+B2(Ax0+By0+C)2(A2+B2)2=(Ax0+By0+C)2A2+B2¯PP=¯PP(x=B2x0ABy0ACA2+B2)=|Ax0+By0+C|A2+B2

25.2 by perpendicular foot

y=ABxCB=1B(Ax+C), if B0

L:(y=BAx+K)(y=ABxCB):L

L=L(x,y)=BxAy+K=0 P=P(x0,y0)L=B(xx0)A(yy0)=0

L=BxAy(Bx0Ay0)=0 perpendicular foot = foot of the perpendicular P

P(LL)={L=Ax+By+C=0L=BxAy(Bx0Ay0)=0={Ax+By=CBxAy=Bx0Ay0P=P(x,y)=(|CBBx0Ay0A||ABBA|,|ACBBx0Ay0||ABBA|)=(|CBBx0+Ay0A||ABBA|,|ACBBx0+Ay0||ABBA|)=(B2x0ABy0ACA2+B2,ABx0+A2y0BCA2+B2)

d(P,L)=¯PP=(x0,y0)(B2x0ABy0ACA2+B2,ABx0+A2y0BCA2+B2)=(x0B2x0ABy0ACA2+B2)2+(y0ABx0+A2y0BCA2+B2)2=(A2x0+ABy0+ACA2+B2)2+(ABx0+B2y0+BCA2+B2)2=A2(Ax0+By0+C)2+B2(Ax0+By0+C)2(A2+B2)2=(Ax0+By0+C)2A2+B2=|Ax0+By0+C|A2+B2

25.3 by normal vector

{n=(A,B)L=Ax+By+C=0PP=PP=(xx0,yy0)

PL的距離d(P,L)即為L線上一點P對應之PPL法向量n方向上的投影長

PPn=PPncosθ|PPn|=PPn|cosθ|PP|cosθ|=|PPˆn|=|PPn|n=|(xx0,yy0)(A,B)|(A,B)=|A(xx0)+B(yy0)|A2+B2=|Ax0By0+Ax+By|A2+B2Ax+By+C=0=Ax+By=C|Ax0By0C|A2+B2=|Ax0+By0+C|A2+B2

PDF LaTeX \usepackage{fdsymbol} to have \overrightharpoon vector; however, there are too many side effects, including ugly mathptmx , …

\usepackage{fdsymbol} % vector over accent, but will use mathptmx
% replace the rather ugly mathptmx \sum operator with the equivalent Computer Modern one
\let\sum\relax
\DeclareSymbolFont{CMlargesymbols}{OMX}{cmex}{m}{n}
\DeclareMathSymbol{\sum}{\mathop}{CMlargesymbols}{"50}

25.4 by Cauchy inequality

Ax+By+C=0Ax+By=C(Ax+By)(Ax0+By0)=C(Ax0+By0)A(xx0)+B(yy0)=(Ax0+By0+C)

¯PP2=(x0x)2+(y0y)2[A2+B2]¯PP2=[A2+B2][(x0x)2+(y0y)2][A(xx0)+B(yy0)]2=[(Ax0+By0+C)]2=(Ax0+By0+C)2¯PP2(Ax0+By0+C)2A2+B2¯PP|Ax0+By0+C|A2+B2