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+B2≠0⇓d(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=0⇒y=−1B(Ax+C)
¯PP′2(x,y)=(x0−x)2+(y0−y)2=(x0−x)2+(y0−−1B(Ax+C))2=(x−x0)2+(ABx+CB+y0)2=¯PP′2(x)
0=∂∂x¯PP′2(x)=2(x−x0)+2(ABx+CB+y0)AB=2B2(B2(x−x0)+A2x+AC+ABy0)=2B2[(A2+B2)x−(B2x0−ABy0−AC)]x=B2x0−ABy0−ACA2+B2 or by completing the square to find x.
¯PP′2(x=B2x0−ABy0−ACA2+B2)=(B2x0−ABy0−ACA2+B2−x0)2+(ABB2x0−ABy0−ACA2+B2+CB+y0)2=(−A2x0−ABy0−ACA2+B2)2+(A(B2x0−ABy0−AC)+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=B2x0−ABy0−ACA2+B2)=|Ax0+By0+C|√A2+B2
25.2 by perpendicular foot
y=−ABx−CB=−1B(Ax+C), if B≠0
L⊥:(y=BAx+K)⊥(y=−ABx−CB):L
L⊥=L⊥(x,y)=Bx−Ay+K=0 P=P(x0,y0)∈L⊥=B(x−x0)−A(y−y0)=0
L⊥=Bx−Ay−(Bx0−Ay0)=0 perpendicular foot = foot of the perpendicular P′
P′∈(L⊥∩L)={L=Ax+By+C=0L⊥=Bx−Ay−(Bx0−Ay0)=0={Ax+By=−CBx−Ay=Bx0−Ay0P′=P′(x,y)=(|−CBBx0−Ay0−A||ABB−A|,|A−CBBx0−Ay0||ABB−A|)=(|CB−Bx0+Ay0−A||A−BBA|,|ACB−Bx0+Ay0||A−BBA|)=(B2x0−ABy0−ACA2+B2,−ABx0+A2y0−BCA2+B2)
d(P,L)=¯PP′=‖(x0,y0)−(B2x0−ABy0−ACA2+B2,−ABx0+A2y0−BCA2+B2)‖=√(x0−B2x0−ABy0−ACA2+B2)2+(y0−−ABx0+A2y0−BCA2+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=0⇀PP′=P′−P=(x−x0,y−y0)
P到L的距離d(P,L)即為L線上一點P′對應之⇀PP′在L法向量⇀n方向上的投影長
⇀PP′⋅⇀n=‖⇀PP′‖‖⇀n‖cosθ|⇀PP′⋅⇀n|=‖⇀PP′‖‖⇀n‖|cosθ|‖⇀PP′‖|cosθ|=|⇀PP′⋅ˆn|=|⇀PP′⋅⇀n|‖⇀n‖=|(x−x0,y−y0)⋅(A,B)|‖(A,B)‖=|A(x−x0)+B(y−y0)|√A2+B2=|−Ax0−By0+Ax+By|√A2+B2Ax+By+C=0=Ax+By=−C|−Ax0−By0−C|√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}