2D 座標架
Author: 藍邦偉  老師

$Step=%v$

$A$

$B$

$P$

$H$

$Q$

$P'$

$C$

$ 反射原理 $

$若P,Q在L的同側，\;想在直線L$
$上找一點C，\;使得\overline{PC}+\overline{QC}$
$有最小值$
$\;$
$ 移動A,B決定直線L ，\;移動P,Q$

$  1.\;找 P\;關於L\;的對稱點P'$

$ 2.\;連\overline{PQ},\;此時$
$\;\;\;\;\Delta PHC≅\Delta P'HC(SAS) $

$ 3.\;取\overline{P'Q}與L的交點C $

$ 4.\;則C\;點即為所求 $

B_0 = (5.982970786095927, -0.4125906573277876)
A_0 = (1.2958509313991846, 1.6705732738641184)
Q_0 = (7.247749159585524, 1.372978426550989)
P_0 = (1.2214522035468554, 7.225677090375868)
Q_2: 0.7 * Corner[1] + 0.3 * Corner[2]
Q_3: (x(Q_2), y(Corner[4]))
poly1, q_1, q_2, q_4, q_3 = Polygon(Corner[1], Q_2, Q_3, Corner[4])
s = 0 (slider from 0 to 6, step 1)
t1 = 0 (slider from 0 to 1, step 0.01)
t2 = 0 (slider from 0 to 1, step 0.01)
t3 = 0 (slider from 0 to 1, step 0.01)
t4 = 0 (slider from 0 to 1, step 0.01)
t5 = 0 (slider from 0 to 1, step 0.01)
A = DynamicCoordinates(A_0, floor(x(A_0)), floor(y(A_0)))
B = DynamicCoordinates(B_0, floor(x(B_0)), floor(y(B_0)))
L = Line(A, B)
P = DynamicCoordinates(P_0, floor(x(P_0)), floor(y(P_0)))
L_2 = OrthogonalLine(P, L)
H = Intersect(L, L_2)
Q = DynamicCoordinates(Q_0, floor(x(Q_0)), floor(y(Q_0)))
P' = Mirror(P, L)
b = Segment(Q, P')
C = Intersect(b, L)
c = Segment(P, C)
P_1: P + 2 * t1 * Vector[P, H]
u_1 = Vector(P, P_1)
P_2: P' + t2 * Vector[P', Q]
u_2 = Vector(P', P_2)
a = Segment(P, P')
poly2, c_1, p, h = Polygon(P, H, C)
poly3, c_2, p', h_1 = Polygon(P', H, C)
P_3: P + t3 * Vector[P, C]
u_3 = Vector(P, P_3)
d = Segment(C, P')
P_4: C + t4 * Vector[C, Q]
u_4 = Vector(C, P_4)
text5: "$ 已知P" + (LaTeX[P]) + ",Q" + (LaTeX[Q]) + "為直線$
$L：\;" + (LaTeX[L]) + "同側的兩$
$點，\;欲在L\;上找一點C，\;使得 $
$\overline{PA}+\overline{PB}有最小值$"
u = Vector((x(Q_2), 0), (x(Corner[2]), 0))
v = Vector((0, y(Corner[1])), (0, y(Corner[3])))
text6: "$ 參考答案 $
$C(" + (LaTeX[FractionText[x(C)]]) + "," + (LaTeX[FractionText[y(C)]]) + "),\;此時$
$\overline{PC}+\overline{QC}=\overline{P'C}+\overline{QC}$
$=" + (LaTeX[SurdText[Distance[P, C]]]) + "+" + (LaTeX[SurdText[Distance[C, Q]]]) + "=" + (LaTeX[SurdText[Distance[P', Q]]]) + "=\overline{P'Q}$"