I have a piece of code that generates a circle on a sphere, but the problem is, this code creates only one circle. How can I change it in order to create n circles on the same sphere? Do I have to put the code in a loop?
Needs["Combinatorica`"];
greatCircle[\[CurlyPhi]_, \[Theta]_, r_: 1] :=
BSplineCurve[
Composition[RotationTransform[\[Theta], {0, 0, 1}],
RotationTransform[-\[CurlyPhi], {0, 1,
0}]] /@ (r {{1, 0, 0}, {1, 1, 0}, {-1, 1, 0}, {-1, 0,
0}, {-1, -1, 0}, {1, -1, 0}, {1, 0, 0}}), SplineDegree -> 2,
SplineKnots -> {0, 0, 0, 1/4, 1/2, 1/2, 3/4, 1, 1, 1},
SplineWeights -> {1, 1/2, 1/2, 1, 1/2, 1/2, 1}]
With[{\[CurlyEpsilon] =
1*^-3 (*shrinks sphere slightly*), \[CurlyPhi] =
30 \[Degree] (*inclination*)},
Graphics3D[{{Opacity[2/5, Blue],
Sphere[{0, 0, 0}, 1 - \[CurlyEpsilon]]}, {Directive[
AbsoluteThickness[3], Red], greatCircle[\[CurlyPhi], 0]}},
Lighting -> "Neutral"]]
With[{ε = 1*^-3, φ = 45 °, n = 5}, Module[{step = 360 °/n}, Graphics3D[{{Opacity[2/5, Blue], Sphere[{0, 0, 0}, 1 - ε]}, {AbsoluteThickness[3], Red, Table[greatCircle[φ, θ], {θ, (Range[n] - 1) step}]}}, Lighting -> "Neutral"]]]
Of course you could make the table vary overφ
rather thanθ
. $\endgroup$Graphics3D[{greatCircle[0, 0], greatCircle[π/2, 0]}]
. $\endgroup$