正四面體
Author: 藍邦偉  老師

α = 3.064798166502043 rad (slider from 0*° to 6.283185307179586, step 0.1*°)
β = 4.5256387504212965 rad (slider from 0 to 6.283185307179586, step 0.1*°)
O = (81.08279809135202, 10.000603697435272)
X_{unit}: O + (cos(α), sin(α) * cos(β))
Y_{unit}: O + (-sin(α), cos(α) * cos(β))
Z_{unit}: O + (0, -sin(β))
u = Vector(O, X_{unit})
v = Vector(O, Y_{unit})
w = Vector(O, Z_{unit})
A_1: O + 2 * sqrt(6) * w
A_2: O + sqrt(3) * u - 3 * v
A_3: O + sqrt(3) * u + 3 * v
A_4: O - 2 * sqrt(3) * u
多邊形1 = Poly_Y3(A_1, A_2, A_4)
多邊形2 = Poly_B3(A_1, A_3, A_2)
多邊形3 = Poly_P3(A_1, A_4, A_3)
a, b = SDLine(A_1, A_3, A_4, A_2)
c, d = SDLine(A_1, A_2, A_3, A_4)
e, f = SDLine(A_1, A_4, A_2, A_3)
多邊形4 = Poly_G3(A_3, A_4, A_2)
g, h = SDLine(A_3, A_4, A_1, A_2)
i, j = SDLine(A_4, A_2, A_1, A_3)
k, l = SDLine(A_3, A_2, A_4, A_1)
A_a: (Corner[1] + Corner[3]) / 2

Tool: Poly_B3
Input: A, B, C
Output: poly1'

α = Angle(C, B, A)
d: sqrt(sgn(sin(α)))
A' = Dilate(A, d, A)
B' = Dilate(B, d, A)
C' = Dilate(C, d, A)
poly1', c', a', b' = Polygon(A', B', C')

Tool: Poly_Y3
Input: A, B, C
Output: poly1

poly1 = Poly_B3(A, B, C)

Tool: Poly_C3
Input: A, B, C
Output: poly1

poly1 = Poly_B3(A, B, C)

Tool: Poly_P3
Input: A, B, C
Output: poly1

poly1 = Poly_B3(A, B, C)

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)

Tool: Poly_G3
Input: A, B, C
Output: poly1'

α = Angle(C, B, A)
d: sqrt(sgn(sin(α)))
A' = Dilate(A, d, A)
B' = Dilate(B, d, A)
C' = Dilate(C, d, A)
poly1', c', a', b' = Polygon(A', B', C')