Sphere
Author: Daniel Mentrard
Date: 8 Janvier 2014

Move the points

zoom = 1 (slider from -5 to 5, step 0.1)
C = (-8.679204962757026, -4.2682497512118)
View3D = (-6.88114894870685, -0.18694800503440928)
X: C + (-zoom * sin(x(View3D)) * cos(y(View3D)), -zoom * sin(y(View3D)))
Y: C + (zoom * cos(x(View3D)), zoom * 0)
v = Vector(C, Y)
Z: C + (-zoom * sin(x(View3D)) * sin(y(View3D)), zoom * cos(y(View3D)))
u = Vector(C, X)
w = Vector(C, Z)
n = 50 (slider from 1 to 50, step 1)
O = (-3.042442061567978, -2.7270588820259323)
R = 3 (slider from 1 to 5, step 0.1)
h = 4.1 (slider from 1 to 12, step 0.1)
liste1 = Sequence(O + R * cos(i) * u + R * sin(i) * v, i, 0, 6.283185307179586, 2 * π / n)
A: O + h * w
liste2 = Sequence(Segment[Element[liste1, i], A], i, 1, Length[liste1])
a = CurveCartesian(x(O + R * cos(i) * u + R * sin(i) * v), y(O + R * cos(i) * u + R * sin(i) * v), i, 0, 6.283185307179586)
OO: O + R * u
s = Segment(OO, A)
B = Point(s)
OO1: O - R * u
b = Segment(OO1, OO)
c = Segment(A, O)
d = Line(B, b)
D = Intersect(d, c)
E = (-8.308177531286356, -2.684248024548547)
F: E + (R, 0)
G: E + (0, h)
poly1, g, e, f = Polygon(E, F, G)
r1: Distance[D, O] / Distance[O, A]
EE: E + (0, Distance[E, G] * r1)
i = Line(EE, g)
H, I = Intersect(i, poly1)
r = Distance(H, I)
j = CurveCartesian(x(D + r * cos(i) * u + r * sin(i) * v), y(D + r * cos(i) * u + r * sin(i) * v), i, 0, 6.28319)
J = (4.378106567845453, -2.983924026890244)
z = Vector(O, J)
a' = Translate(a, z)
liste1' = Translate(liste1, z)
D' = Translate(D, z)
j' = Translate(j, z)
liste3 = Sequence(D' + r * cos(i) * u + r * sin(i) * v, i, 0, 6.28319, 2 * π / n)
K = (3.5647002757751345, 0.45521485712636905)
l = Vector(D', K)
liste3' = Translate(liste3, l)
j'' = Translate(j', l)
liste4 = Sequence(Segment[Element[liste1', i], Element[liste3, i]], i, 1, Length[liste1])
L: A + z + l
liste5 = Sequence(Segment[Element[liste3', i], L], i, 1, Length[liste1])
m = CurveCartesian(x(D + r * cos(i) * u + r * sin(i) * v), y(D + r * cos(i) * u + r * sin(i) * v), i, 0, 6.28319)
o = CurveCartesian(x(O + R * cos(i) * u + R * sin(i) * v), y(O + R * cos(i) * u + R * sin(i) * v), i, 0, 6.28319)
p = Segment(O, OO1)
M: D - r * u
q = Segment(D, M)
a'_1 = Translate(a, z)
j'_1 = Translate(j, z)
k = Translate(j'_1, l)
liste6 = Sequence(Polygon[Element[liste1, i], Element[liste1, i + 1], A], i, 1, Length[liste1])
O' = Translate(O, z)
OO1' = Translate(OO1, z)
p' = Segment(O', OO1')
D'_1 = Translate(D, z)
M' = Translate(M, z)
q' = Segment(D'_1, M')
t = Segment(D', J)
D'_2 = Translate(D, Vector[z + l])
M'_1 = Translate(M, Vector[z + l])
q'_1 = Segment(D'_2, M'_1)
a_1 = Segment(L, K)
texte1: "r=" + r + ""
b_1 = Translate(j'_1, l)
liste7 = Sequence(Polygon[Element[liste3', i], Element[liste3', i + 1], L], i, 1, Length[liste1])
liste8 = Sequence(Polygon[Element[liste1', i], Element[liste1', i + 1], Element[liste3, i + 1], Element[liste3, i]], i, 1, Length[liste1])