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

汽車

單位向量

單位點

座標軸

xy平面

x

y

z

α = 4.014257279586958 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
β = 5.061454830783555 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
L = 10 (slider from 1 to 10, step 1)
O = (60.7011330480389, 8.724699829556043)
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)
A = (20.64, 16.56)
h = false
i = false
j = false
k = false
A_1: O + 0 * u - 8 * v + 0 * w
A_2: O + 6 * u - 8 * v + 0 * w
A_3: O + 6 * u - 8 * v - 4 * w
a = Segment(A_1, A_2)
b = Segment(A_2, A_3)
A_4: O + 0 * u - 8 * v - 4 * w
c = Segment(A_1, A_4)
d = Segment(A_3, A_4)
A_5: O + 6 * u + 8 * v
e = Segment(A_2, A_5)
A_6: O + 0 * u + 8 * v + 0 * w
A_7: O + 6 * u + 4 * v
A_8: O + 6 * u - 4 * v
f = Segment(A_6, A_5)
A_9: O + 6 * u + 8 * v - 4 * w
g = Segment(A_3, A_9)
A_10: O + 0 * u + 8 * v - 4 * w
m = Segment(A_5, A_9)
p = Segment(A_10, A_9)
q = Segment(A_6, A_10)
A_12: O + 6 * u - 4 * v + 5 * w
r = Segment(A_12, A_8)
A_13: O + 6 * u + 4 * v + 5 * w
s = Segment(A_13, A_7)
t = Segment(A_12, A_13)
a_1 = Segment(A_10, A_4)
b_1 = Segment(A_6, A_1)
A_14: O + 0 * u - 4 * v
A_15: O + 0 * u + 4 * v
A_16: O + 0 * u + 4 * v + 5 * w
A_17: O + 0 * u - 4 * v + 5 * w
c_1 = Segment(A_12, A_17)
d_1 = Segment(A_14, A_17)
e_1 = Segment(A_13, A_16)
f_1 = Segment(A_17, A_16)
g_1 = Segment(A_16, A_15)
h_1 = Segment(A_7, A_15)
i_1 = Segment(A_8, A_14)
A_18: O + 6 * u + 2 * v + 3.5 * w
A_19: O + 6 * u + 2 * v + 1.5 * w
j_1 = Segment(A_18, A_19)
A_20: O + 6 * u - 2 * v + 1.5 * w
k_1 = Segment(A_19, A_20)
A_21: O + 6 * u - 2 * v + 3.5 * w
l_1 = Segment(A_21, A_20)
m_1 = Segment(A_21, A_18)
A_22: O - 2 * v + 3.5 * w
A_23: O - 2 * v + 1.5 * w
n_1 = Segment(A_22, A_23)
A_24: O + 2 * v + 1.5 * w
A_25: O + 2 * v + 3.5 * w
p_1 = Segment(A_25, A_24)
q_1 = Segment(A_24, A_23)
poly1, a_21, a_18, a_19, a_20 = Polygon(A_21, A_18, A_19, A_20)
poly2, a_25, a_22, a_23, a_24 = Polygon(A_25, A_22, A_23, A_24)
poly3, a_2, a_5, a_9, a_3 = Polygon(A_2, A_5, A_9, A_3)
poly4, a_12, a_13, a_7, a_8 = Polygon(A_12, A_13, A_7, A_8)
poly5, a_4, a_6, a_{10}, a_{11} = Polygon(A_21, A_20, A_19, A_18)
poly6, a_16, a_17, a_14, a_15 = Polygon(A_16, A_17, A_14, A_15)
poly7, a_{12}, a_{13}, a_{14}, a_{15} = Polygon(A_13, A_12, A_8, A_7)
poly8, a_{16}, a_{17}, a_{18}, a_{19} = Polygon(A_12, A_13, A_7, A_8)
poly9, a_{20}, a_{21}, a_{22}, a_{23} = Polygon(A_21, A_18, A_19, A_20)
poly10, a_{24}, a_{25}, a_{26}, a_{27} = Polygon(A_25, A_22, A_23, A_24)
poly11, a_{28}, a_{29}, a_{30}, a_{31} = Polygon(A_12, A_17, A_16, A_13)
poly12, a_{32}, a_{33}, a_{34}, a_{35} = Polygon(A_13, A_16, A_15, A_7)
poly13, a_{36}, a_{37}, a_{38}, a_{39} = Polygon(A_17, A_12, A_8, A_14)
B_1: O + 6 * u + 4 * v - 6 * w
B_2: O + 6 * u - 4 * v - 6 * w
r_1 = 2 (slider from -5 to 5, step 1)
o = CurveCartesian(x(B_2 + r_1 * cos(θ) * v + r_1 * sin(θ) * w), y(B_2 + r_1 * cos(θ) * v + r_1 * sin(θ) * w), θ, 0, 6.283185307179586)
z = CurveCartesian(x(B_1 + r_1 * cos(θ) * v + r_1 * sin(θ) * w), y(B_1 + r_1 * cos(θ) * v + r_1 * sin(θ) * w), θ, 0, 6.283185307179586)
B_3: O - 4 * v - 6 * w
B_4: O + 4 * v - 6 * w
o_1 = CurveCartesian(x(B_3 + r_1 * cos(θ) * v + r_1 * sin(θ) * w), y(B_3 + r_1 * cos(θ) * v + r_1 * sin(θ) * w), θ, 0, 6.283185307179586)
s_1 = CurveCartesian(x(B_4 + r_1 * cos(θ) * v + r_1 * sin(θ) * w), y(B_4 + r_1 * cos(θ) * v + r_1 * sin(θ) * w), θ, 0, 6.283185307179586)
poly14, a_{40}, a_{41}, a_{42}, a_{43} = Polygon(A_2, A_5, A_9, A_3)
poly15, a_{44}, a_{45}, a_{46}, a_{47} = Polygon(A_1, A_2, A_3, A_4)
poly16, a_{48}, a_{49}, a_10, a_{50} = Polygon(A_5, A_6, A_10, A_9)
poly17, a_{51}, a_{52}, a_{53}, a_{54} = Polygon(A_6, A_1, A_4, A_10)
poly18, a_{55}, a_{56}, a_{57}, a_{58} = Polygon(A_2, A_5, A_6, A_1)
poly19, a_{59}, a_{60}, a_{61}, a_{62} = Polygon(A_17, A_12, A_8, A_14)
poly20, a_{63}, a_{64}, a_{65}, a_{66} = Polygon(A_12, A_13, A_7, A_8)
poly21, a_{67}, a_{68}, a_{69}, a_{70} = Polygon(A_13, A_16, A_15, A_7)
poly22, a_{71}, a_{72}, a_{73}, a_{74} = Polygon(A_17, A_16, A_13, A_12)
poly24, a_{80}, a_{81}, a_{82}, a_{83} = Polygon(A_16, A_17, A_14, A_15)
poly23, a_{75}, a_{76}, a_{77}, a_{78} = Polygon(A_22, A_25, A_24, A_23)
poly25, a_{79}, a_{84}, a_{85}, a_{86} = Polygon(A_21, A_18, A_19, A_20)
poly26, a_{87}, a_{88}, a_{89}, a_{90} = Polygon(A_4, A_1, A_6, A_10)
poly27, a_{91}, a_{92}, a_{93}, a_{94} = Polygon(A_4, A_1, A_6, A_10)
poly28, a_{95}, a_{96}, a_{97}, a_{98} = Polygon(A_3, A_4, A_1, A_2)
poly29, a_{99}, a_{100}, a_{101}, a_{102} = Polygon(A_6, A_15, A_7, A_5)
poly30, a_{103}, a_{104}, a_{105}, a_{106} = Polygon(A_1, A_14, A_8, A_2)
t_1 = Segment(B_2, B_3)
b_2 = Segment(B_1, B_4)
B = Intersect(r, t)
C = Point(c_1)
D = Intersect(d_1, i_1)
E = Intersect(e, r)
poly31, b_3, c_2, d_2, e_2 = Polygon(B, C, D, E)
poly32, a_{107}, a_{108}, a_{109}, a_{110} = Polygon(A_16, A_13, A_7, A_15)
poly33, a_{111}, a_{112}, a_{113}, a_{114} = Polygon(A_15, A_7, A_8, A_14)
poly34, a_{115}, a_{116}, a_{117}, a_{118} = Polygon(A_18, A_19, A_20, A_21)
poly35, a_{119}, a_{120}, a_{121}, a_{122} = Polygon(A_22, A_23, A_24, A_25)
poly36, a_{123}, a_{124}, a_{125}, a_{126} = Polygon(A_10, A_6, A_1, A_4)
poly37, a_{127}, a_{128}, a_{129}, a_{130} = Polygon(A_3, A_4, A_1, A_2)
poly38, a_{131}, a_{132}, a_{133}, a_{134} = Polygon(A_9, A_3, A_2, A_5)
poly39, a_{135}, a_{136}, a_{137}, a_{138} = Polygon(A_12, A_13, A_7, A_8)
poly40, a_{139}, a_{140}, a_{141}, a_{142} = Polygon(A_13, A_16, A_15, A_7)
poly41, c_3, a_{143}, a_{144}, a_{145} = Polygon(C, A_12, A_8, A_14)
poly42, a_{146}, a_{147}, a_{148}, a_{149} = Polygon(A_19, A_20, A_21, A_18)
poly43, a_{150}, a_{151}, a_{152}, a_{153} = Polygon(A_22, A_25, A_24, A_23)