甜甜圈
Author: 藍邦偉　老師

單位向量

座標軸

Start

x

y

z

$ 甜甜圈 $

O = (10.001376041200228, 1.238242609278878)
β = 1.1344640137963142 rad (slider from 0 to 6.283185307179586, step 0.1*°)
Z_{unit}: O + (0, sin(β))
w = Vector(O, Z_{unit})
α = 4.276056667386108 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 = 5 (slider from 1 to 10, step 1)
a = Vector(O - L * v, O + L * v)
b = Vector(O - L * w, O + L * w)
z = Vector(O - L * u, O + L * u)
c = false
d = true
Q_2: 0.2 * Corner[2] + 0.8 * Corner[1]
Q_3: (x(Q_2), y(Corner[3]))
g = Segment(Q_2, Q_3)
poly1, h, q_1, q_4, i = Polygon(Corner[1], Q_2, Q_3, Corner[4])
r_1 = 3.9 (slider from 1 to 5, step 0.1)
r_2 = 1 (slider from 1 to 5, step 0.1)
m = 29 (slider from 1 to 60, step 1)
list1 = Sequence(CurveCartesian[x(O + (r_1 + r_2 * cos(t)) * cos(s) * u + (r_1 + r_2 * cos(t)) * sin(s) * v + r_2 * sin(t) * w), y(O + (r_1 + r_2 * cos(t)) * cos(s) * u + (r_1 + r_2 * cos(t)) * sin(s) * v + r_2 * sin(t) * w), t, 0, 6.28], s, 0, 6.28, 2 * 3.14 / m)
n = 20 (slider from 1 to 30, step 1)
list2 = Sequence(CurveCartesian[x(O + (r_1 + r_2 * cos(t)) * cos(s) * u + (r_1 + r_2 * cos(t)) * sin(s) * v + r_2 * sin(t) * w), y(O + (r_1 + r_2 * cos(t)) * cos(s) * u + (r_1 + r_2 * cos(t)) * sin(s) * v + r_2 * sin(t) * w), s, 0, 6.28], t, 0, 6.28, 2 * 3.14 / n)
γ = 4.731587602156628 rad (slider from 0 to 6.28318530717959, step 0.1*°)
c_1 = CurveCartesian(x(O + (r_1 + r_2 * cos(t)) * cos(γ) * u + (r_1 + r_2 * cos(t)) * sin(γ) * v + r_2 * sin(t) * w), y(O + (r_1 + r_2 * cos(t)) * cos(γ) * u + (r_1 + r_2 * cos(t)) * sin(γ) * v + r_2 * sin(t) * w), t, 0, 6.28)