三垂線定理例題
Author: 藍邦偉　老師

單位向量

座標軸

x

y

z

$ 三垂線定理例題 $

B_1(-1,-5,0)

B_2(5,3,0)

P

A

B

C

α = 4.276056667386108 rad (slider from 0 to 6.283185307179586, step 0.01*°)
β = 1.4835298641951802 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
O = (9.222798637958117, 2.957139606328777)
X_{unit}: O + (cos(α), sin(α) * cos(β))
Y_{unit}: O + (-1 * sin(α), cos(α) * cos(β))
Z_{unit}: O + (0, sin(β))
u = Vector(O, X_{unit})
v = Vector(O, Y_{unit})
w = Vector(O, Z_{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 = 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]))
g = Segment(Q_2, Q_3)
poly1, h, q_1, q_4, i = Polygon(Corner[1], Q_2, Q_3, Corner[4])
A_1: O + 5 * u + 5 * v
A_2: O - 5 * u + 5 * v
A_3: O - 5 * u - 5 * v
A_4: O + 5 * u - 5 * v
poly2, a_1, a_2, a_3, a_4 = Polygon(A_1, A_2, A_3, A_4)
B_1: 0.6 * A_3 + 0.4 * A_4
B_2: 0.8 * A_1 + 0.2 * A_4
B: O + 44 / 25 * u - 33 / 25 * v
B' = Mirror(B, O)
A: 0.5 * (O + B')
P: A + 2.49 * w
C: 0.9 * B_2 + 0.1 * B_1
e_1, e_2 = SDLine(P, C, B, A)
e_3, e_4 = SDLine(P, B, A, C)
e_5, e_6 = SDLine(P, A, C, B)
e_8, e_7 = SDLine(A, C, P, B)
e_9, e_0 = SDLine(A, B, C, P)
e_a, e_b = SDLine(B, C, A, P)

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)