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

正八角柱

單位向量

單位點

座標軸

xy平面

x

y

z

α = 1.9146261894377796 rad (slider from 0 to 6.283185307179586, step 0.1*°)
β = 1.7453292519943295 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
L = 2 (slider from 1 to 10, step 1)
O = (0, 0)
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_1 = false
i = false
j = false
k = false
r = 2.05 (slider from 0 to 5, step 0.01)
h = 2.8 (slider from 0 to 5, step 0.01)
A_1: O + r * cos(0°) * u + r * sin(0°) * v
A_2: O + r * cos(135°) * u + r * sin(135°) * v
A_3: O + r * cos(270°) * u + r * sin(270°) * v
A_4: O + r * cos(405°) * u + r * sin(405°) * v
A_5: O + r * cos(540°) * u + r * sin(540°) * v
A_6: O + r * cos(675°) * u + r * sin(675°) * v
A_7: O + r * cos(810°) * u + r * sin(810°) * v
A_8: O + r * cos(945°) * u + r * sin(945°) * v
A_9: O + r * cos(1080°) * u + r * sin(1080°) * v
poly1, a_1, a_4, a_7, a_2, a_5, a_8, a_3, a_6 = Polygon(A_1, A_4, A_7, A_2, A_5, A_8, A_3, A_6)
B_1: A_1 + h * w
B_2: A_2 + h * w
B_3: A_3 + h * w
B_4: A_4 + h * w
B_5: A_5 + h * w
B_6: A_6 + h * w
B_7: A_7 + h * w
B_8: A_8 + h * w
poly2, b_2, b_7, b_4, b_1, b_6, b_3, b_8, b_5 = Polygon(B_2, B_7, B_4, B_1, B_6, B_3, B_8, B_5)
a_a = Segment(A_1, B_1)
a_b = Segment(A_2, B_2)
a_c = Segment(A_3, B_3)
a_d = Segment(A_4, B_4)
a_e = Segment(A_5, B_5)
a_f = Segment(A_6, B_6)
a_g = Segment(A_7, B_7)
a_h = Segment(A_8, B_8)
A = 3.839724354387525 rad
poly3, b_{11}, a_{12}, a_{13}, b_{12} = Polygon(B_6, A_6, A_1, B_1)
poly4, b_9, a_9, a_{10}, b_{10} = Polygon(B_1, A_1, A_4, B_4)
poly5, b_{13}, a_{11}, a_{14}, b_{14} = Polygon(B_4, A_4, A_7, B_7)
poly6, b_{15}, a_{15}, a_{16}, b_{16} = Polygon(B_7, A_7, A_2, B_2)
B2 = 0
poly7, b_{17}, a_{17}, a_{18}, b_{18} = Polygon(B_2, A_2, A_5, B_5)
poly8, b_{19}, b_{20}, a_{19}, a_{20} = Polygon(B_5, B_8, A_8, A_5)
poly9, b_{21}, a_{21}, a_{22}, b_{22} = Polygon(B_8, A_8, A_3, B_3)
poly10, b_{23}, a_{23}, a_{24}, b_{24} = Polygon(B_3, A_3, A_6, B_6)
poly11, a_{25}, a_{26}, a_{27}, a_{28}, a_{29}, a_{30}, a_{31}, a_{32} = Polygon(A_8, A_3, A_6, A_1, A_4, A_7, A_2, A_5)
poly12, a_{33}, a_{34}, a_{35}, a_{36}, a_{37}, a_{38}, a_{39}, a_{40} = Polygon(A_8, A_3, A_6, A_1, A_4, A_7, A_2, A_5)
poly13, b_{25}, b_{26}, b_{27}, b_{28}, b_{29}, b_{30}, b_{31}, b_{32} = Polygon(B_6, B_1, B_4, B_7, B_2, B_5, B_8, B_3)