Author: 藍邦偉　老師
Date: 22 2 月 2014

$O$

將中心平移至原點

$A(2,0,0)$

單位向量

座標軸

Start

x

y

z

$ O $

$C(0,0,2)$

$D(2,2,2)$

$G(1,1,1)$

$B(0,2,0)$

$B'$

$A'$

$S_1$

$C'$

$D'$

$S_2$

$Step=%v$

O

$正四面體的史坦納樹$

O = (15.07634597639246, 2.370890042559613)
β = 1.3962634015954636 rad (slider from 0 to 6.283185307179586, step 0.1*°)
Z_{unit}: O + (0, sin(β))
w = Vector(O, Z_{unit})
α = 4.276056667386108 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})
u_0: -u - v - w
t = 0 (slider from 0 to 1, step 0.01)
A: O + 2 * u + t * u_0
L = 3 (slider from 1 to 10, step 1)
yy = Vector(O - L * v, O + L * v)
zz = Vector(O - L * w, O + L * w)
xx = Vector(O - L * u, O + L * u)
c = false
d = false
Q_2: 0.3 * Corner[2] + 0.7 * Corner[1]
Q_3: (x(Q_2), y(Corner[3]))
g_g = Segment(Q_2, Q_3)
poly1, h, q_1, q_4, i = Polygon(Corner[1], Q_2, Q_3, Corner[4])
C: O + 2 * w + t * u_0
D: O + 2 * u + 2 * v + 2 * w + t * u_0
G: O + u + v + w + t * u_0
B: O + 2 * v + t * u_0
B': A - u + v - sqrt(6) * w
A': O + (6 + sqrt(6)) / 4 * u + (2 - sqrt(6)) / 4 * v + (sqrt(6) + 1) / 2 * w + t * u_0
h_0 = Segment(G, B')
h_1 = Segment(B, A')
S_1: O + u + v + sqrt(6) / 3 * w + t * u_0
C': C + u + v + sqrt(6) * w
D': D + (-6 + 3 * sqrt(6)) / 12 * u + (-6 + 3 * sqrt(6)) / 12 * v + (-6 - 6 * sqrt(6)) / 12 * w
h_3 = Segment(C', G)
h_2 = Segment(D', C)
S_2: O + u + v + (6 - sqrt(6)) / 3 * w + t * u_0
b_1 = Segment(S_1, B)
b_2 = Segment(S_1, A)
b_3 = Segment(S_1, S_2)
b_4 = Segment(C, S_2)
b_5 = Segment(D, S_2)
triangle1, b_6, g_1, a_{13} = Polygon(G, A, B)
k_1 = Segment(B', B)
k_0 = Segment(B', A)
k_2 = Segment(A', A)
k_3 = Segment(A', G)
k_4 = Segment(C', C)
k_5 = Segment(C', D)
triangle2, g_2, c_1, d_1 = Polygon(C, D, G)
k_6 = Segment(D', D)
k_7 = Segment(D', G)
z_a = Segment(G, A)
z_b = Segment(G, B)
z_c = Segment(G, C)
z_d = Segment(G, D)
n = 1 (slider from 1 to 17, step 1)
a = false
a_1, a_2 = SDLine(D, A, C, B)
a_3, a_4 = SDLine(D, B, A, C)
a_5, a_6 = SDLine(C, A, B, D)
a_7, a_8 = SDLine(D, C, B, A)
a_9, a_{10} = SDLine(B, A, D, C)
a_{11}, a_{12} = SDLine(B, C, A, D)
poly2 = Poly_C3(D, A, B)
poly3 = Poly_C3(C, A, D)
poly4 = Poly_C3(C, B, A)
poly5 = Poly_C3(C, D, B)

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_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_C3
Input: A, B, C
Output: poly1

poly1 = Poly_B3(A, B, C)