絕對值不等式 (3)
Author: 藍邦偉老師

$ 絕對值不等式\;(3) $

$ M $

$ Sol： $

u = Vector((x(Corner[1]), 0), (x(Corner[3]), 0))
A_1 = Point(u)
B_1 = Point(u)
A = DynamicCoordinates(A_1, floor(x(A_1)), 0)
B = DynamicCoordinates(B_1, floor(x(B_1)), 0)
a: x(A)
b: x(B)
t_1: "$ 設A(" + (LaTeX[a]) + ") ,B(" + (LaTeX[b]) + ")$"
t_3: "$ ⇒\frac{1}{2}\;\overline{AB}=" + (LaTeX[FractionText[abs(b - a) / 2]]) + " $"
t_2: "$⇒ \overline{AB}=" + (LaTeX[abs(b - a)]) + " $"
t_4: "$ 取\overline{AB}的中點M(" + (LaTeX[FractionText[(a + b) / 2]]) + ") $"
M = Midpoint(A, B)
m: x(M)
t_{Question}: "$如何將\; " + (LaTeX[Min[a, b]]) + "≤x≤" + (LaTeX[Max[a, b]]) + " \;表為\;|x-a|≤b\;的型式$"
n = 0 (slider from 0 to 6, step 1)
Poly1, k_2, k_3, k_4, k_1 = Polygon(A, A + (0, 0.5), B + (0, 0.5), B)
t_5: "$ ⇒|x" + (LaTeX[If[m > 0, "-", If[m < 0, "+", ""]]]) + "" + (LaTeX[If[m ≠ 0, FractionText[abs(m)], ""]]) + "| ≤" + (LaTeX[FractionText[abs(b - a) / 2]]) + "$"
t_6: "$ ⇒a=" + (LaTeX[FractionText[x(M)]]) + " \;,b=" + (LaTeX[FractionText[abs(a - b) / 2]]) + "$"