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′=‖
25.3 by normal vector
\begin{cases} \overset{\rightharpoonup}{n}=\left(A,B\right)\perp L=Ax+By+C=0\\ \overset{\rightharpoonup}{PP^{\prime}}=P^{\prime}-P=\left(x-x_{0},y-y_{0}\right) \end{cases}
P到L的距離d\left(P,L\right)即為L線上一點P^{\prime}對應之\overset{\rightharpoonup}{PP^{\prime}}在L法向量\overset{\rightharpoonup}{n}方向上的投影長
\begin{aligned} \overset{\rightharpoonup}{PP^{\prime}}\cdot\overset{\rightharpoonup}{n}= & \left\Vert \overset{\rightharpoonup}{PP^{\prime}}\right\Vert \left\Vert \overset{\rightharpoonup}{n}\right\Vert \cos\theta\\ \left|\overset{\rightharpoonup}{PP^{\prime}}\cdot\overset{\rightharpoonup}{n}\right|= & \left\Vert \overset{\rightharpoonup}{PP^{\prime}}\right\Vert \left\Vert \overset{\rightharpoonup}{n}\right\Vert \left|\cos\theta\right|\\ \left\Vert \overset{\rightharpoonup}{PP^{\prime}}\right\Vert \left|\cos\theta\right|= & \left|\overset{\rightharpoonup}{PP^{\prime}}\cdot\widehat{\boldsymbol{n}}\right|=\dfrac{\left|\overset{\rightharpoonup}{PP^{\prime}}\cdot\overset{\rightharpoonup}{n}\right|}{\left\Vert \overset{\rightharpoonup}{n}\right\Vert }=\dfrac{\left|\left(x-x_{0},y-y_{0}\right)\cdot\left(A,B\right)\right|}{\left\Vert \left(A,B\right)\right\Vert }\\ = & \dfrac{\left|A\left(x-x_{0}\right)+B\left(y-y_{0}\right)\right|}{\sqrt{A^{2}+B^{2}}}=\dfrac{\left|-Ax_{0}-By_{0}+Ax+By\right|}{\sqrt{A^{2}+B^{2}}}\\ \begin{subarray}{c} Ax+By+C=0\\ =\\ Ax+By=-C \end{subarray} & \dfrac{\left|-Ax_{0}-By_{0}-C\right|}{\sqrt{A^{2}+B^{2}}}=\dfrac{\left|Ax_{0}+By_{0}+C\right|}{\sqrt{A^{2}+B^{2}}} \end{aligned}
PDF LaTeX \usepackage{fdsymbol}
to have \overrightharpoon
vector; however, there are too many side effects, including ugly mathptmx \sum, …
\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
\begin{aligned} Ax+By+C= & 0\\ Ax+By= & -C\\ \left(Ax+By\right)-\left(Ax_{0}+By_{0}\right)= & -C-\left(Ax_{0}+By_{0}\right)\\ A\left(x-x_{0}\right)+B\left(y-y_{0}\right)= & -\left(Ax_{0}+By_{0}+C\right) \end{aligned}
\begin{aligned} \overline{PP^{\prime}}^{2}= & \left(x_{0}-x\right)^{2}+\left(y_{0}-y\right)^{2}\\ \left[A^{2}+B^{2}\right]\overline{PP^{\prime}}^{2}= & \left[A^{2}+B^{2}\right]\left[\left(x_{0}-x\right)^{2}+\left(y_{0}-y\right)^{2}\right]\\ \ge & \left[A\left(x-x_{0}\right)+B\left(y-y_{0}\right)\right]^{2}\\ = & \left[-\left(Ax_{0}+By_{0}+C\right)\right]^{2}=\left(Ax_{0}+By_{0}+C\right)^{2}\\ \overline{PP^{\prime}}^{2}\ge & \dfrac{\left(Ax_{0}+By_{0}+C\right)^{2}}{A^{2}+B^{2}}\\ \overline{PP^{\prime}}\ge & \dfrac{\left|Ax_{0}+By_{0}+C\right|}{\sqrt{A^{2}+B^{2}}} \end{aligned}