3D 座標架的製作
Author: 藍邦偉  老師

截六面體

單位向量

單位點

座標軸

xy平面

x

y

z

α = 5.585053606381854 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
β = 1.3962634015954636 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
L = 2 (slider from 1 to 10, step 1)
O = (29.8, 12.78)
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})
x_{Axis} = Vector(O - L * u, O + L * u)
y_{Axis} = Vector(O - L * v, O + L * v)
z_{Axis} = Vector(O - L * w, O + L * w)
h = false
i = false
j = false
k = false
A_1: O + u + v + w
A_2: O + u + v - w
A_3: O + u - v - w
A_4: O + u - v + w
A_5: O - u + v + w
A_6: O - u - v + w
A_7: O - u - v - w
A_8: O - u + v - w
B = Midpoint(A_5, A_1)
C = Midpoint(A_5, A_6)
D = Midpoint(A_5, A_8)
E = Midpoint(A_8, A_2)
F = Midpoint(A_8, A_7)
G = Midpoint(A_6, A_7)
H = Midpoint(A_6, A_4)
I = Midpoint(A_4, A_3)
J = Midpoint(A_2, A_3)
K = Midpoint(A_1, A_4)
M = Midpoint(A_7, A_3)
N = Midpoint(H, A_4)
P = Midpoint(H, A_6)
Q = Midpoint(C, A_6)
R = Midpoint(C, A_5)
S = Midpoint(A_5, B)
T = Midpoint(D, A_5)
U = Midpoint(D, A_8)
V = Midpoint(A_8, E)
W = Midpoint(F, A_8)
Z = Midpoint(F, A_7)
B_1 = Midpoint(A_6, G)
C_1 = Midpoint(G, A_7)
D_1 = Midpoint(K, A_4)
E_1 = Midpoint(K, A_1)
F_1 = Midpoint(J, A_2)
G_1 = Midpoint(E, A_2)
H_1 = Midpoint(J, A_3)
I_1 = Midpoint(M, A_3)
J_1 = Midpoint(M, A_7)
K_1 = Midpoint(A_4, I)
L_1 = Midpoint(I, A_3)
M_1 = Midpoint(A_1, A_2)
N_1 = Midpoint(M_1, A_2)
O_1 = Midpoint(M_1, A_1)
b_1 = Segment(J_1, Z)
c_1 = Segment(J_1, C_1)
d_1 = Segment(Z, C_1)
e_1 = Segment(W, V)
f_1 = Segment(W, U)
g_1 = Segment(V, U)
h_1 = Segment(T, R)
i_1 = Segment(S, R)
j_1 = Segment(S, T)
k_1 = Segment(I_1, H_1)
l_1 = Segment(L_1, H_1)
m_1 = Segment(L_1, I_1)
n_1 = Segment(K_1, N)
p_1 = Segment(D_1, N)
q_1 = Segment(K_1, D_1)
a_2 = Segment(G_1, F_1)
d_2 = Segment(G_1, N_1)
P_1 = Midpoint(B, A_1)
e_2 = Segment(P_1, E_1)
f_2 = Segment(P_1, O_1)
g_2 = Segment(E_1, O_1)
h_2 = Segment(B_1, Q)
i_2 = Segment(P, Q)
j_2 = Segment(B_1, P)
a = Segment(N_1, F_1)
b = Segment(G_1, V)
c = Segment(H_1, F_1)
d = Segment(Z, W)
e = Segment(D_1, E_1)
f = Segment(Q, R)
g = Segment(I_1, J_1)
l = Segment(O_1, N_1)
m = Segment(P_1, S)
n = Segment(T, U)
p = Segment(K_1, L_1)
q = Segment(N, P)
r = Segment(B_1, C_1)
poly1, p_2, s, t, u_1, v_1, g_3, n_2, o_1 = Polygon(P_1, S, T, U, V, G_1, N_1, O_1)
poly2, h_3, l_2, k_2, d_3, e_3, o_2, n_3, f_3 = Polygon(H_1, L_1, K_1, D_1, E_1, O_1, N_1, F_1)
poly3, b_2, c_2, j_3, i_3, l_3, k_3, n_4, p_3 = Polygon(B_1, C_1, J_1, I_1, L_1, K_1, N, P)
poly4, t_1, r_1, q_2, b_3, c_3, z, w_1, u_2 = Polygon(T, R, Q, B_1, C_1, Z, W, U)
poly5, g_4, v_2, w_2, z_1, j_4, i_4, h_4, f_4 = Polygon(G_1, V, W, Z, J_1, I_1, H_1, F_1)
poly6, d_4, e_4, p_4, s_1, r_2, q_3, p_5, n_5 = Polygon(D_1, E_1, P_1, S, R, Q, P, N)
poly7, z_2, c_4, j_5 = Polygon(C_1, J_1, Z)
poly8, s_2, t_2, r_3 = Polygon(T, S, R)
poly9, n_6, g_5, f_5 = Polygon(G_1, F_1, N_1)
poly10, h_5, i_5, l_4 = Polygon(I_1, L_1, H_1)
poly11, a_1, m_2, a_3 = Polygon(O_1, E_1, P_1)
poly12, m_3, s_3, t_3 = Polygon(W, V, U)
poly13, k_4, d_5, n_7 = Polygon(D_1, N, K_1)
poly14, b_4, p_7, q_4 = Polygon(P, Q, B_1)