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

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

x

y

z

顯示xy平面

顯示單位向量

顯示座標軸

正立方體與截平面所成的截痕

Q

R

P

Q

Reset

Step 1

Step 2

O = (0.40884833624082234, -1.5885340974672513)
A: (x((Corner[3] + 39 * Corner[4]) / 40), y((Corner[1] + 9 * Corner[4]) / 10))
B: (x((4 * Corner[3] + 16 * Corner[4]) / 20), y((Corner[1] + 9 * Corner[4]) / 10))
D: (3 * B + A) / 4
a = Segment(A, B)
E = Point(a)
C: (3 * A + B) / 4
E' = Rotate(Translate[E, Vector[C, D]], 90*°, D)
c = Circle(C, E)
c' = Translate(c, Vector[C, D])
G = Point(c')
c'' = Rotate(c', 270*°, C)
F = Point(c'')
A' = Rotate(A, 270*°, C)
B' = Rotate(B, 270*°, C)
a' = Segment(A', B')
D' = Rotate(D, 270*°, C)
b = Segment(D', F)
E'' = Rotate(E', 270*°, C)
α = Angle(E'', D', F)
d = Segment(D, G)
β = Angle(G, D, E')
K: C + (0, b * cos(β))
K' = Translate(K, Vector[C, O])
w = Vector(O, K')
J: C + (b * cos(α + 90°), b * sin(α + 90°) * sin(β))
J' = Translate(J, Vector[C, O])
v = Vector(O, J')
I: C + (b * cos(α), b * sin(α) * sin(β))
I' = Translate(I, Vector[C, O])
u = Vector(O, I')
A_2: O + 3 * u + 3 * v - 3 * w
A_1: O + 3 * u + 3 * v + 3 * w
W = Dilate(A_2, 2, A_1)
l_1 = Segment(A_2, W)
A_4: O - 3 * u + 3 * v + 3 * w
Z = Dilate(A_4, 2, A_1)
m_1 = Segment(A_4, Z)
A_3: O + 3 * u - 3 * v + 3 * w
N = Dilate(A_3, 2, A_1)
g_1 = Segment(N, A_3)
e = Segment(C, K)
f = Segment(C, I)
g = Segment(C, J)
L = 6 (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, O)
J''' = Dilate(J'', -1, O)
K''' = Dilate(K'', -1, 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)
list2 = Sequence(CurveCartesian[x(O + t * u + s * v), y(O + t * u + s * v), s, -L, L], t, -L, L, 1)
A_6: O + 3 * u - 3 * v - 3 * w
A_7: O - 3 * u + 3 * v - 3 * w
A_8: O - 3 * u - 3 * v - 3 * w
A_5: O - 3 * u - 3 * v + 3 * w
m = Segment(A_3, A_1)
n_1 = Segment(A_1, A_4)
p = Segment(A_4, A_5)
q = Segment(A_5, A_3)
r = Segment(A_3, A_6)
s = Segment(A_6, A_2)
t = Segment(A_2, A_1)
a_1 = Segment(A_4, A_7)
b_1 = Segment(A_7, A_2)
c_1 = Segment(A_6, A_8)
d_1 = Segment(A_8, A_5)
e_1 = Segment(A_8, A_7)
l = true
n = Line(A_1, A_2)
f_1 = Line(A_1, A_4)
g_2 = Line(A_3, A_1)
P = Point(g_1)
M = Point(m_1)
h_1 = Segment(P, M)
H = Point(l_1)
i_1 = Segment(M, H)
j_1 = Segment(H, P)
P_1 = Intersect(r, j_1)
Q = Intersect(j_1, i_1)
R = Intersect(a_1, i_1)
S = Intersect(p, h_1)
T = Intersect(q, h_1)
U = Intersect(s, j_1)
V = Intersect(i_1, b_1)
多邊形1, r_1, s_1, t_1, p_1, u_1, v_1 = Polygon(R, S, T, P_1, U, V)
C_a: C + (b * cos(α + 190°), b * sin(α + 190°) * sin(β))
C_b: C + (b * cos(α + 10°), b * sin(α + 10°) * sin(β))
C_c: C + (b * cos(α + 210°), b * sin(α + 210°) * sin(β))
C_d: C + (b * cos(α + 200°), b * sin(α + 200°) * sin(β))
C_e: C + (b * cos(α + 320°), b * sin(α + 320°) * sin(β))
k_1 = Conic(C_a, C_b, C_c, C_d, C_e)
多邊形2, h_2, m_2, p_2 = Polygon(M, P, H)
start = 0 (slider from 0 to 2, step 1)
B_1 = Point(r)
C_1 = Point(t)
D_1: B_1 - 6 * u
E_1: C_1 + D_1 - B_1
多邊形3, b_2, c_2, e_2, d_2 = Polygon(B_1, C_1, E_1, D_1)
q_1, a_2 = SDLine(A_3, A_6, A_5, A_1)
f_2, i_2 = SDLine(A_3, A_1, A_6, A_5)
j_2, k_2 = SDLine(A_5, A_3, A_8, A_4)
l_2, n_2 = SDLine(A_1, A_2, A_6, A_7)
q_2, r_2 = SDLine(A_4, A_7, A_1, A_5)
s_2, t_2 = SDLine(A_1, A_4, A_2, A_3)
a_3, b_3 = SDLine(A_5, A_8, A_4, A_3)
c_3, d_3 = SDLine(A_4, A_5, A_7, A_1)
e_3, f_3 = SDLine(A_2, A_6, A_1, A_7)
g_3, h_3 = SDLine(A_6, A_8, A_3, A_2)
i_3, j_3 = SDLine(A_7, A_2, A_4, A_8)
k_3, l_3 = SDLine(A_8, A_7, A_5, A_6)

Tool: SDLine
Input: A, B, C, D
Output: g, h

b: sgn(sin(Angle[D, B, A]))
a: sgn(sin(Angle[A, B, C]))
c: sgn(a + b + 0.5)
d: sqrt(c)
e: sqrt(-c)
E = Midpoint(A, B)
A' = Dilate(A, d, E)
B' = Dilate(B, d, E)
g = Segment(A', B')
A'_1 = Dilate(A, e, E)
B'_1 = Dilate(B, e, E)
h = Segment(A'_1, B'_1)