Author: 藍邦偉　老師
Date: 13 3 月 2014

$O$

單位向量

座標軸

Start

x

y

z

$ O $

$A_0$

$A_1$

$A_2$

$A_3$

$A_4$

$B_0$

$B_1$

$B_2$

$B_3$

$B_4$

O = (16.77525818261293, 3.12212119235122)
β = 1.2147491593880533 rad (slider from 0 to 6.283185307179586, step 0.1*°)
Z_{unit}: O + (0, sin(β))
w = Vector(O, Z_{unit})
α = 3.8536869884034797 rad (slider from 0 to 6.283185307179586, step 0.1*°)
X_{unit}: O + (cos(α), sin(α) * cos(β))
u = Vector(O, X_{unit})
Y_{unit}: O + (-1 * sin(α), cos(α) * cos(β))
v = Vector(O, Y_{unit})
L = 2 (slider from 1 to 10, step 1)
yy = Vector(O - L * v, O + L * v)
zz = Vector(O - L * w, O + L * w)
xx = Vector(O - L * u, O + L * u)
c = false
d = true
Q_2: 0.3 * Corner[2] + 0.7 * Corner[1]
Q_3: (x(Q_2), y(Corner[3]))
poly1, q_3, q_1, q_4, q_2 = Polygon(Corner[1], Q_2, Q_3, Corner[4])
h = 1 (slider from 1 to 5, step 0.01)
r = 1 (slider from 1 to 5, step 0.1)
A_0: O + r * u - h * w
A_1: O + r * cos(72°) * u + r * sin(72°) * v - h * w
A_2: O + r * cos(144°) * u + r * sin(144°) * v - h * w
A_3: O + r * cos(216°) * u + r * sin(216°) * v - h * w
A_4: O + r * cos(288°) * u + r * sin(288°) * v - h * w
B_0: O + r * cos(180°) * u + r * sin(180°) * v + h * w
B_1: O + r * cos(252°) * u + r * sin(252°) * v + h * w
B_2: O + r * cos(324°) * u + r * sin(324°) * v + h * w
B_3: O + r * cos(36°) * u + r * sin(36°) * v + h * w
B_4: O + r * cos(108°) * u + r * sin(108°) * v + h * w
d_{11}, d_{12} = SDLine(B_2, B_3, A_0, B_0)
d_{21}, d_{22} = SDLine(B_3, B_4, A_1, B_0)
d_{31}, d_{32} = SDLine(B_4, B_0, A_2, B_3)
d_{51}, d_{52} = SDLine(B_1, B_2, A_4, B_0)
d_{61}, d_{62} = SDLine(A_2, A_1, B_4, A_3)
d_{41}, d_{42} = SDLine(B_0, B_1, A_3, B_4)
d_{71}, d_{72} = SDLine(A_1, A_0, B_3, A_3)
d_{81}, d_{82} = SDLine(A_0, A_4, B_2, A_2)
d_{91}, d_{92} = SDLine(A_4, A_3, B_1, A_1)
d_{01}, d_{02} = SDLine(A_3, A_2, B_0, A_0)
triangle_0 = Poly_B3(A_3, B_0, A_2)
triangle_1 = Poly_B3(A_2, B_4, A_1)
triangle_2 = Poly_B3(A_1, B_3, A_0)
triangle_3 = Poly_B3(A_0, B_2, A_4)
triangle_4 = Poly_B3(A_4, B_1, A_3)
triangle_5 = Poly_B3(A_4, B_2, B_1)
triangle_6 = Poly_B3(A_3, B_1, B_0)
triangle_7 = Poly_B3(A_2, B_0, B_4)
triangle_8 = Poly_B3(A_1, B_4, B_3)
triangle_9 = Poly_B3(A_0, B_3, B_2)
pentagon_1 = Poly_G5(A_0, A_4, A_3, A_2, A_1)
pentagon_2 = Poly_G5(B_0, B_1, B_2, B_3, B_4)
c_{02}, c_{01} = SDLine(A_4, B_2, A_0, B_1)
c_{11}, c_{12} = SDLine(A_3, B_1, A_4, B_0)
c_{21}, c_{22} = SDLine(A_2, B_0, A_3, B_4)
c_{31}, c_{32} = SDLine(A_1, B_4, A_2, B_3)
c_{41}, c_{42} = SDLine(A_0, B_3, A_1, B_2)
c_{51}, c_{52} = SDLine(A_1, B_3, B_4, A_0)
c_{61}, c_{62} = SDLine(A_0, B_2, B_3, A_4)
c_{71}, c_{72} = SDLine(A_4, B_1, B_2, A_3)
c_{81}, c_{82} = SDLine(A_3, B_0, B_1, A_2)
c_{91}, c_{92} = SDLine(A_2, B_4, B_0, A_1)

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)

Tool: Poly_B3
Input: A, B, C
Output: poly1'

α = Angle(C, B, A)
d: sqrt(sgn(sin(α)))
A' = Dilate(A, d, A)
B' = Dilate(B, d, A)
C' = Dilate(C, d, A)
poly1', c', a', b' = Polygon(A', B', C')

Tool: Poly_G5
Input: A, B, C, D, E
Output: poly1'

poly1, a, b, c, d, e = Polygon(A, B, C, D, E)
F = Midpoint(b)
G = Midpoint(d)
α = Angle(G, F, A)
f: sqrt(sgn(sin(α)))
A' = Dilate(A, f, A)
B' = Dilate(B, f, A)
C' = Dilate(C, f, A)
D' = Dilate(D, f, A)
E' = Dilate(E, f, A)
poly1', a', b', c', d', e' = Polygon(A', B', C', D', E')