極值的應用(8)
Author: 藍邦偉　老師

單位向量

座標軸

x

y

z

微分的應用(8)

O = (10.089854060581015, 0.9295640478443544)
β = 1.3945180723434694 rad (slider from 0 to 6.283185307179586, step 0.1*°)
Z_{unit}: O + (0, sin(β))
w = Vector(O, Z_{unit})
α = 4.274311338134114 rad (slider from 0 to 6.283185307179586, step 0.1*°)
X_{unit}: O + (cos(α), sin(α) * cos(β))
u = Vector(O, X_{unit})
Y_{unit}: O + (-1 * sin(α), cos(α) * cos(β))
v = Vector(O, Y_{unit})
L = 7 (slider from 1 to 10, step 1)
a = Vector(O - L * v, O + L * v)
b = Vector(O - L * w, O + L * w)
z_1 = Vector(O - L * u, O + L * u)
c = false
d = false
Q_2: 0.2 * Corner[2] + 0.8 * Corner[1]
Q_3: (x(Q_2), y(Corner[3]))
z = Segment(Q_2, Q_3)
poly1, h_1, q_1, q_4, i = Polygon(Corner[1], Q_2, Q_3, Corner[4])
r = 1.9 (slider from 1 to 3, step 0.1)
A_1: O + r * u + r * v
A_2: O - r * u + r * v
A_3: O - r * u - r * v
A_4: O + r * u - r * v
h = 5.6 (slider from 1 to 6, step 0.1)
H: O + h * w
a_1, a_2 = SDLine(H, A_1, A_4, A_2)
a_3, a_4 = SDLine(H, A_2, A_1, A_3)
a_5, a_6 = SDLine(H, A_3, A_2, A_4)
a_7, a_8 = SDLine(H, A_4, A_3, A_1)
a_9, a_{10} = SDLine(A_4, A_1, A_3, H)
a_{11}, a_{12} = SDLine(A_4, A_3, H, A_1)
a_{13}, a_{14} = SDLine(A_2, A_1, H, A_3)
a_{15}, a_{16} = SDLine(A_3, A_2, H, A_4)
z_{center} = Segment(O, H)
t = 0.8 (slider from 0.1 to r - 0.1, step 0.1)
B_1: O + t * u + t * v
B_2: O - t * u + t * v
B_3: O - t * u - t * v
B_4: O + t * u - t * v
B_5: B_1 + h * (1 - t / r) * w
B_6: B_2 + h * (1 - t / r) * w
B_7: B_3 + h * (1 - t / r) * w
B_8: B_4 + h * (1 - t / r) * w
b_1, b_2 = SDLine(B_6, B_2, B_5, B_7)
b_3, b_4 = SDLine(B_7, B_3, B_6, B_8)
b_5, b_6 = SDLine(B_8, B_4, B_7, B_5)
b_7, b_8 = SDLine(B_5, B_1, B_8, B_6)
poly2, a_{17}, a_{18}, a_{19}, a_{20} = Polygon(A_1, A_2, A_3, A_4)
b_9, b_{10} = SDLine(B_7, B_6, B_8, B_3)
b_{11}, b_{12} = SDLine(B_8, B_7, B_5, B_4)
b_{13}, b_{14} = SDLine(B_6, B_5, B_7, B_2)
b_{15}, b_{16} = SDLine(B_5, B_8, B_6, B_1)
b_{17}, b_{18} = SDLine(B_1, B_4, B_5, B_2)
b_{19}, b_{20} = SDLine(B_2, B_1, B_6, B_3)
b_{21}, b_{22} = SDLine(B_3, B_2, B_7, B_4)
b_{23}, b_{24} = SDLine(B_4, B_3, B_8, B_1)
poly3, b_{25}, b_{26}, b_{27}, b_{28} = Polygon(B_1, B_2, B_3, B_4)
poly4, b_{29}, b_{30}, b_{31}, b_{32} = Polygon(B_5, B_6, B_7, B_8)

Tool: SDLine
Input: A, B, C, D
Output: g, h

b: sgn(sin(Angle[D, B, A]))
a: sgn(sin(Angle[A, B, C]))
c: sgn(a + b + 0.5)
d: sqrt(c)
e: sqrt(-c)
E = Midpoint(A, B)
A' = Dilate(A, d, E)
B' = Dilate(B, d, E)
g = Segment(A', B')
A'_1 = Dilate(A, e, E)
B'_1 = Dilate(B, e, E)
h = Segment(A'_1, B'_1)