球極投影 (1)
Author: 藍邦偉　老師

單位向量

座標軸

Start

x

y

z

$ S $

$半徑為%v$

經度

$ 球極投影 $

$緯度$

$ 經度 $

$ 座標軸 $

$ N $

O = (9.614194569877718, 3.4731703979691018)
β = 1.3962634015954636 rad (slider from 0 to 6.283185307179586, step 0.1*°)
Z_{unit}: O + (0, sin(β))
w = Vector(O, Z_{unit})
α = 3.9269908169872414 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 = 7 (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 = false
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_1, q_1, q_4, i = Polygon(Corner[1], Q_2, Q_3, Corner[4])
r = 3 (slider from 1 to 5, step 1)
m = 18 (slider from 1 to 40, step 1)
n = 12 (slider from 1 to 12, step 1)
O': O + r * w
List_2 = Sequence(CurveCartesian[x(O' + r * cos(t) * cos(s) * u + r * cos(t) * sin(s) * v + r * sin(t) * w), y(O' + r * cos(t) * cos(s) * u + r * cos(t) * sin(s) * v + r * sin(t) * w), s, 0, 6.28], t, -1.57, 1.57, 3.14 / n)
List_1 = Sequence(CurveCartesian[x(O' + r * cos(t) * cos(s) * u + r * cos(t) * sin(s) * v + r * sin(t) * w), y(O' + r * cos(t) * cos(s) * u + r * cos(t) * sin(s) * v + r * sin(t) * w), t, -1.57, 1.57], s, 0, 6.28, 2 * 3.14 / m)
N: O + 2 * r * w
k = 7 (slider from 0 to n - 2, step 1)
list1 = Sequence(CurveCartesian[x(O + 2 * r * tan(t / 2) * cos(s) * u + 2 * r * tan(t / 2) * sin(s) * v), y(O + 2 * r * tan(t / 2) * cos(s) * u + 2 * r * tan(t / 2) * sin(s) * v), s, 0, 6.28319], t, 0, π - 2 * π / n, π / n)
list2 = Sequence(Segment[O, O + 2 * r * tan(π / 2 - π / n) * cos(s) * u + 2 * r * tan(π / 2 - π / n) * sin(s) * v], s, 0, 6.28319, 2 * π / m)
c_2 = CurveCartesian(x(O + 2 * r * tan((k / n * π) / 2) * cos(s) * u + 2 * r * tan((k / n * π) / 2) * sin(s) * v), y(O + 2 * r * tan((k / n * π) / 2) * cos(s) * u + 2 * r * tan((k / n * π) / 2) * sin(s) * v), s, 0, 6.283185307179586)
c_3 = CurveCartesian(x(O' + r * cos(k * π / n - π / 2) * cos(s) * u + r * cos(k * π / n - π / 2) * sin(s) * v + r * sin(k * π / n - π / 2) * w), y(O' + r * cos(k * π / n - π / 2) * cos(s) * u + r * cos(k * π / n - π / 2) * sin(s) * v + r * sin(k * π / n - π / 2) * w), s, 0, 6.283185307179586)
A = Point(c_3)
E: O' + r * sin(k * π / n - π / 2) * w
l = Ray(N, A)
p = Segment(E, A)
q = Line(O, p)
A' = Intersect(q, l)
z_2 = Vector(N, A')
a = true
h = 1 (slider from 1 to m, step 1)
c_1 = CurveCartesian(x(O' + r * cos(t) * cos(2 * h * π / m) * u + r * cos(t) * sin(2 * h * π / m) * v + r * sin(t) * w), y(O' + r * cos(t) * cos(2 * h * π / m) * u + r * cos(t) * sin(2 * h * π / m) * v + r * sin(t) * w), t, -1.5707963267948966, 1.5707963267948966)
B = Point(c_1)
e = Segment(O, O + 2 * r * tan(π / 2 - π / n) * cos(2 * h * π / m) * u + 2 * r * tan(π / 2 - π / n) * sin(2 * h * π / m) * v)
poly2, t, o, n_1 = Polygon(O, N, O + 2 * r * tan(π / 2 - π / n) * cos(2 * h * π / m) * u + 2 * r * tan(π / 2 - π / n) * sin(2 * h * π / m) * v)
a_1 = Ray(N, B)
B' = Intersect(a_1, e)
z_1 = Vector(N, B')
b = true