兩條線段距離和的最小值
Author: 藍邦偉　老師

討論A,B兩2點在直線L的同側或反側，拉動P點觀察

顯示正確P點位置

顯示橢圓

P

P

兩線段距離和的最小值

在直線L上找一點P，

使得\overline{PA}+\overline{PB}有最小值

Ｌ

A = (5.66, 3.7)
B = (0.2, 1.88)
P = Point(l)
a = Segment(P, A)
b = Segment(P, B)
B' = Mirror(B, l)
p = Line(A, B')
C = Intersect(p, l)
k = Segment(B, B')
d = false
e = false
q: y(A) * y(B)
f = Line(A, B)
D = Intersect(l, f)
E = Point(l)
g = Segment(A, E)
h = Segment(E, B)
text1: "$ \overline{PA}+\overline{PB}=" + (LaTeX[If[y(A) * y(B) > 0, a + b, g + h]]) + " $"
r = Ellipse(B, A, P)