Author: 藍邦偉　老師
Date: 24 3 月 2014

$α=%v$

$β=%v$

$O$

$L=%v$

單位向量

座標軸

x

y

z

$ O $

$Step=%v$

$正四角錐與正四面體$

γ3 = 0 rad (slider from 0 to 125.26438968*°, step 0.1*°)
α = 4.101523742186674 rad (slider from 0 to 6.283185307179586, step 0.1*°)
β = 1.3089969389957472 rad (slider from 0 to 6.283185307179586, step 0.1*°)
O = (10.82133516721971, 2.243371152287007)
Y_{unit}: O + (-1 * sin(α), cos(α) * cos(β))
v = Vector(O, Y_{unit})
X_{unit}: O + (cos(α), sin(α) * cos(β))
u = Vector(O, X_{unit})
Z_{unit}: O + (0, sin(β))
w = Vector(O, Z_{unit})
L = 2.4 (slider from 1 to 3, step 0.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]))
poly1, q_3, q_1, q_4, q_2 = Polygon(Corner[1], Q_2, Q_3, Corner[4])
n = 0 (slider from 0 to 4, step 1)
t1 = 0 (slider from 0 to 1, step 0.01)
A_1: O + u + (1 - t1) * v
A_4: O - u + (1 - t1) * v
A_2: O + u + (3 - t1) * v
A_3: O - u + (3 - t1) * v
A_5: O + (2 - t1) * v + sqrt(2) * w
B_1: O + u - v + t1 * v
B_2: O + u - 3 * v + t1 * v
B_3: O - u - 3 * v + t1 * v
B_4: O - u - v + t1 * v
B_5: O - 2 * v + sqrt(2) * w + t1 * v
a_1, a_2 = SDLine(A_5, A_3, A_2, A_4)
a_3, a_4 = SDLine(A_5, A_2, A_1, A_3)
a_5, a_6 = SDLine(A_5, A_1, A_4, A_2)
a_7, a_8 = SDLine(A_5, A_4, A_3, A_1)
b_1, b_2 = SDLine(B_5, B_4, B_1, B_3)
b_3, b_4 = SDLine(B_5, B_3, B_4, B_2)
b_5, b_6 = SDLine(B_5, B_1, B_2, B_4)
b_7, b_8 = SDLine(B_5, B_2, B_3, B_1)
a_9, a_{10} = SDLine(A_3, A_2, A_5, A_1)
a_{11}, a_{12} = SDLine(A_4, A_3, A_5, A_2)
a_{13}, a_{14} = SDLine(A_1, A_4, A_5, A_2)
a_{15}, a_{16} = SDLine(A_2, A_1, A_5, A_3)
b_9, b_{10} = SDLine(B_4, B_1, B_5, B_3)
b_{11}, b_{12} = SDLine(B_3, B_4, B_5, B_2)
b_{13}, b_{14} = SDLine(B_2, B_3, B_5, B_1)
b_{15}, b_{16} = SDLine(B_1, B_2, B_5, B_4)
γ2 = 0 rad (slider from 0 to 6.283185307179586, step 0.1*°)
t4 = 0 (slider from 0 to 0.86, step 0.01)
C_4: O + 3 * u + 2 * sqrt(6) / 3 * w
C_2: O + 3 * u + 2 / sqrt(3) * (cos(γ2 + 180°) * u + sin(γ2 + 180°) * v)
D_4: C_2 + (2 * sqrt(3) / 3 * cos(γ3) - 2 * sqrt(6) / 3 * sin(γ3)) * u + (2 * sqrt(6) / 3 * cos(γ3) + 2 * sqrt(3) / 3 * sin(γ3)) * w
K_3: O + (3 - 2 / sqrt(3)) * u - v
D_3: K_3 + sqrt(3) * cos(γ3) * u + sqrt(3) * sin(γ3) * w
K_1: O + (3 - 2 / sqrt(3)) * u + v
D_1: K_1 + sqrt(3) * cos(γ3) * u + sqrt(3) * sin(γ3) * w
C_3: O + 3 * u + 2 / sqrt(3) * (cos(γ2 + 300°) * u + sin(γ2 + 300°) * v)
C_1: O + 3 * u + 2 / sqrt(3) * (cos(γ2 + 60°) * u + sin(γ2 + 60°) * v)
poly21 = Poly_P3(C_4, C_2, C_3)
poly31 = Poly_P3(D_4, C_2, D_3)
poly22 = Poly_P3(C_4, C_3, C_1)
poly23 = Poly_P3(C_4, C_1, C_2)
poly24 = Poly_P3(C_3, C_2, C_1)
poly32 = Poly_P3(D_4, D_3, D_1)
poly33 = Poly_P3(D_4, D_1, C_2)
poly34 = Poly_P3(D_1, D_3, C_2)
E_1: D_1 - t4 * u
E_3: D_3 - t4 * u
E_2: C_2 - t4 * u
E_4: D_4 - t4 * u
poly41 = Poly_P3(E_3, E_4, E_2)
poly42 = Poly_P3(E_1, E_4, E_3)
poly43 = Poly_P3(E_1, E_2, E_4)
poly44 = Poly_P3(E_1, E_3, E_2)

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

poly1 = Poly_B3(A, B, C)