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

3D 座標架的製作

座標軸

x

y

z

α = 4.101523742186674 rad (slider from 0 to 6.283185307179586, step 0.1*°)
β = 5.1487212933832724 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
L = 6 (slider from 1 to 10, step 1)
O = (25.429924460351064, 13.933339250444762)
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)
j = false
A_1: O + 2 * cos(0°) * u + 2 * sin(0°) * v + w
A_2: O + 2 * cos(60°) * u + 2 * sin(60°) * v + w
A_3: O + 2 * cos(120°) * u + 2 * sin(120°) * v + w
A_4: O + 2 * cos(180°) * u + 2 * sin(180°) * v + w
A_5: O + 2 * cos(240°) * u + 2 * sin(240°) * v + w
A: O + 2 * cos(240°) * u + 2 * sin(240°) * v + w
A_6: O + 2 * cos(300°) * u + 2 * sin(300°) * v + w
B_1: O + 2 * cos(30°) * u + 2 * sin(30°) * v - w
B_2: O + 2 * cos(90°) * u + 2 * sin(90°) * v - w
B_3: O + 2 * cos(150°) * u + 2 * sin(150°) * v - w
B_4: O + 2 * cos(210°) * u + 2 * sin(210°) * v - w
B_5: O + 2 * cos(270°) * u + 2 * sin(270°) * v - w
B_6: O + 2 * cos(330°) * u + 2 * sin(330°) * v - w
C_1: O + 5 * w
C_2: O - 5 * w
poly1, c_1, a_1, b_1, a_2 = Polygon(C_1, A_1, B_1, A_2)
poly2, c_2, a_6, b_6, a_3 = Polygon(C_1, A_6, B_6, A_1)
poly3, c_3, a_4, b_2, a_5 = Polygon(C_1, A_2, B_2, A_3)
poly4, c_4, a_7, b_3, a_8 = Polygon(C_1, A_3, B_3, A_4)
poly5, c_5, a_9, b_4, a_{10} = Polygon(C_1, A_4, B_4, A_5)
poly6, c_6, a_{11}, b_5, a_{12} = Polygon(C_1, A_5, B_5, A_6)
poly7, b_7, c_7, b_8, a_{13} = Polygon(B_6, C_2, B_1, A_1)
poly8, a_{14}, b_9, c_8, b_{10} = Polygon(A_2, B_1, C_2, B_2)
poly9, a_{15}, b_{11}, c_9, b_{12} = Polygon(A_3, B_2, C_2, B_3)
poly10, a_{16}, b_{13}, c_{10}, b_{14} = Polygon(A_4, B_3, C_2, B_4)
poly11, a_{17}, b_{15}, c_{11}, b_{16} = Polygon(A_5, B_4, C_2, B_5)
poly12, a_{18}, b_{17}, c_{12}, b_{18} = Polygon(A_6, B_5, C_2, B_6)