正立方體與截平面
Author: 藍邦偉  老師

拉動start開始，移動P,Q,R三點觀察通過這三點的平面與正立方體所截的圖形

x

y

z

顯示xy平面

顯示單位向量

顯示座標軸

兩面角

O = (-2.415519721965066, -4.49383555337338)
A: (x((Corner[3.0] + 39.0 * Corner[4.0]) / 40.0), y((Corner[1.0] + 9.0 * Corner[4.0]) / 10.0))
B: (x((4.0 * Corner[3.0] + 16.0 * Corner[4.0]) / 20.0), y((Corner[1.0] + 9.0 * Corner[4.0]) / 10.0))
D: (3.0 * B + A) / 4.0
a = Segment(A, B)
E = Point(a)
C: (3.0 * A + B) / 4.0
E' = Rotate(Translate[E, Vector[C, D]], 90.0*°, D)
c = Circle(C, E)
c' = Translate(c, Vector[Vector[C, D]])
G = Point(c')
c'' = Rotate(c', 270.0*°, C)
F = Point(c'')
A' = Rotate(A, 270.0*°, C)
B' = Rotate(B, 270.0*°, C)
a' = Segment(A', B')
D' = Rotate(D, 270.0*°, C)
b = Segment(D', F)
E'' = Rotate(E', 270.0*°, C)
α = Angle(E'', D', F)
d = Segment(D, G)
β = Angle(G, D, E')
K: C + (0.0, b * cos(β))
K' = Translate(K, Vector[Vector[C, O]])
w = Vector(O, K')
J: C + (b * cos(α + 90.0°), b * sin(α + 90.0°) * sin(β))
J' = Translate(J, Vector[Vector[C, O]])
v = Vector(O, J')
I: C + (b * cos(α), b * sin(α) * sin(β))
I' = Translate(I, Vector[Vector[C, O]])
u = Vector(O, I')
e = Segment(C, K)
f = Segment(C, I)
g = Segment(C, J)
L = 10 (slider from 1 to 10, step 1)
I'' = Dilate(I', L, O)
J'' = Dilate(J', L, O)
K'' = Dilate(K', L, O)
I''' = Dilate(I'', -1.0, O)
J''' = Dilate(J'', -1.0, O)
K''' = Dilate(K'', -1.0, O)
u' = Vector(I''', I'')
v' = Vector(J''', J'')
w' = Vector(K''', K'')
h = Segment(D', E'')
i = Segment(D, E')
軌跡1 = Locus(I, F)
L_{axis}: L
j = false
k = false
list1 = Sequence(CurveCartesian[x(O + t * u + s * v), y(O + t * u + s * v), t, -(L), L], s, -(L), L, 1.0)
list2 = Sequence(CurveCartesian[x(O + t * u + s * v), y(O + t * u + s * v), s, -(L), L], t, -(L), L, 1.0)
l = false
C_a: C + (b * cos(α + 190.0°), b * sin(α + 190.0°) * sin(β))
C_b: C + (b * cos(α + 10.0°), b * sin(α + 10.0°) * sin(β))
C_c: C + (b * cos(α + 210.0°), b * sin(α + 210.0°) * sin(β))
C_d: C + (b * cos(α + 200.0°), b * sin(α + 200.0°) * sin(β))
C_e: C + (b * cos(α + 320.0°), b * sin(α + 320.0°) * sin(β))
k_1 = Conic(C_a, C_b, C_c, C_d, C_e)
θ = 0 rad (slider from 0 to 3.141592653589793, step 0.017453292519943295)
A_a: O
A_b: O + 12.0 * w
A_c: A_b + 6.0 * cos(θ) * u + 6.0 * sin(θ) * v
A_d: A_a + 6.0 * cos(θ) * u + 6.0 * sin(θ) * v
多邊形1, a_d, a_a, a_b, a_c = Polygon(A_d, A_a, A_b, A_c)
B_a: A_a + 6.0 * u
B_b: A_b + 6.0 * u
多邊形2, a_1, a_2, b_b, b_a = Polygon(A_a, A_b, B_b, B_a)
P_b: A_b + w
P_a: A_a - w
P_c: P_b - 15.0 * u
P_d: P_a - 15.0 * u
P_e: P_b + 8.0 * u
P_f: P_a + 8.0 * u
多邊形3, p_c, p_e, p_f, p_d = Polygon(P_c, P_e, P_f, P_d)
P_g: A_b - 7.0 * u
P_h: P_g - 6.0 * u
P_i: P_h - 6.0 * w
P_j: P_g - 6.0 * w
n = 1 (slider from 0 to 3, step 1)