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

18.物件群組單位向量, 座標軸 ,xy平面

1. 做角度滑竿α,0°到360°，增量1°

2. 做角度滑竿β,0°到360°，增量1°

3. 任選一新點O作為空間座標系的原點

4. 作點X_{unit}=O+(cos(α),sin(α)cos(β))

5. 作點Y_{unit}=O+(-sin(α),cos(α)cos(β))

6. 作點Z_{unit}=O+(0,sin(β))

7. 作向量u=Vector[O,X_{unit}]

8. 作向量v=Vector[O,Y_{unit}]

9. 作向量w=Vector[O,Z_{unit}]

10. 作數值滑竿L，範圍為1至10，增量為1

11. 作向量a=Vector[O-L*u,O+L*u]

12. 作向量b=Vector[O-L*v,O+L*v]

13. 作向量c=Vector[O-L*w,O+L*w]

14. 作點X_{x}=O+L*u,標籤x，點縮小到1

15. 作點Y_{y}=O+L*v,標籤y，點縮小到1

16. 作點Z_{z}=O+L*w,標籤z，點縮小到1

17. 作多邊形Polygon[O+L u+L v,O-L u+L v,O-L u-L v,O+L u-L v]

房子

單位向量

單位點

座標軸

xy平面

x

y

z

α = 3.371976114853045 rad (slider from 0 to 6.283185307179586)
β = 4.799655442984406 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
L = 1 (slider from 1 to 10, step 1)
O = (2.0177774211817243, -6.405259364848421)
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)
多邊形1, d, e, f, g = Polygon(O + L * u + L * v, O - L * u + L * v, O - L * u - L * v, O + L * u - L * v)
A = (20.64, 16.56)
h = false
i = false
j = false
k = false
A_1: O + 0 * u + 0 * v + 0 * w
A_2: O + 6 * u + 0 * v + 0 * w
A_3: O + 6 * u + 6 * v + 0 * w
A_4: O + 0 * u + 6 * v + 0 * w
A_5: O + 0 * u + 0 * v + 10 * w
A_6: O + 6 * u + 0 * v + 10 * w
A_7: O + 6 * u + 6 * v + 10 * w
A_8: O + 0 * u + 6 * v + 10 * w
A_9: O + 3 * u + 3 * v + 15 * w
poly1, a_2, o, a_4, a_3 = Polygon(A_2, O, A_4, A_3)
poly2, a_6, a_5, a_8, a_7 = Polygon(A_6, A_5, A_8, A_7)
poly3, a_1, a_9, a_{10}, a_{11} = Polygon(A_6, A_2, A_3, A_7)
poly4, a_{12}, a_{13}, a_{14}, a_{15} = Polygon(A_8, A_7, A_3, A_4)
poly5, a_{16}, a_{17}, o_1, a_{18} = Polygon(A_8, A_4, O, A_5)
poly6, a_{19}, o_2, a_{20}, a_{21} = Polygon(A_5, O, A_2, A_6)
poly7, a_{22}, a_{23}, a_{24} = Polygon(A_9, A_8, A_5)
poly8, a_{25}, a_{26}, a_{27} = Polygon(A_9, A_5, A_6)
poly9, a_{28}, a_{29}, a_{30} = Polygon(A_9, A_7, A_8)
poly10, a_{31}, a_{32}, a_{33} = Polygon(A_9, A_6, A_7)
A_{10}: O + 6 * u + 2 * v + 0 * w
A_{11}: O + 6 * u + 4 * v + 0 * w
A_{12}: O + 6 * u + 2 * v + 5 * w
A_{13}: O + 6 * u + 4 * v + 5 * w
poly11, a_12, a_10, a_11, a_13 = Polygon(A_{12}, A_{10}, A_{11}, A_{13})
A_{14}: O + 6 * u + 3 * v + 8 * w
r = 1.2 (slider from 1 to 1.5, step 0.1)
a = CurveCartesian(x(A_{14} + r * cos(θ) * w + r * sin(θ) * v), y(A_{14} + r * cos(θ) * w + r * sin(θ) * v), θ, 0, 6.283185307179586)
b = Segment(A_7, A_3)
c = Segment(A_7, A_9)
m = Segment(A_8, A_4)
p = Segment(A_9, A_8)
q = Segment(A_9, A_6)
s = Segment(A_6, A_2)
t = Segment(A_9, A_5)
b_1 = Segment(A_5, A_1)
c_1 = Segment(A_1, A_2)
d_1 = Segment(A_2, A_3)
e_1 = Segment(A_3, A_4)
f_1 = Segment(A_4, A_1)
h_1 = Segment(A_5, A_6)
i_1 = Segment(A_7, A_8)
j_1 = Segment(A_8, A_5)
k_1 = Segment(A_{10}, A_{11})
l_1 = Segment(A_{12}, A_{10})
n_1 = Segment(A_{13}, A_{11})
m_1 = Segment(A_5, A_1)
p_1 = Segment(A_6, A_7)
q_1 = Segment(A_5, A_6)
r_1 = Segment(A_9, A_6)
s_1 = Segment(A_7, A_8)
t_1 = Segment(A_9, A_8)
b_2 = Segment(A_9, A_7)
c_2 = Segment(A_8, A_5)
d_2 = Segment(A_9, A_5)