3
$\begingroup$

This question already has an answer here:

I want to plot a 3D plot of a section of sphere with radius $r=1$, along with marking few points like $(\theta_1, \phi_1), (\theta_2, \phi_2)\ldots$. on it. How can I achieve it ?

Following command gives me a section of sphere, now how can I mark a point say $(\pi/8, \pi/8)$ on the surface

SphericalPlot3D[1, {phi, 0, Pi/4}, {theta, 0, Pi/2}]

thanks

$\endgroup$

marked as duplicate by José Antonio Díaz Navas, MarcoB, Kuba Apr 27 '18 at 18:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1
$\begingroup$

For example, you can use Show together with ListPointPlot3D:

points = N@CoordinateTransformData["Spherical" -> "Cartesian", "Mapping", #] & /@ {{1, Pi/8, Pi/8}, {1, Pi/4, Pi/8}};
Show[
     SphericalPlot3D[1, {phi, 0, Pi/4}, {theta, 0, Pi/2}],
     ListPointPlot3D[points, PlotStyle -> Directive[Red, PointSize -> .03]]
     ]

enter image description here

If you want the points to be 2D instead of 3D spheres, you can use the following:

Show[
     SphericalPlot3D[1, {phi, 0, Pi/4}, {theta, 0, Pi/2}],
     Plot3D[Sqrt[1 - x^2 - y^2], {x, -1, 1}, {y, -1, 1}, 
            PlotPoints -> 100, Mesh -> None, PlotStyle -> Red, 
            RegionFunction -> Function[{x, y}, 
                              Or @@ Table[Sqrt[(x - points[[i, 1]])^2 + (y - 
                              points[[i, 2]])^2] < .02, {i, 1, Length[points]}]]]
     ]

enter image description here

$\endgroup$
1
$\begingroup$
f = {Sin[#] Cos[#2], Sin[#] Sin[#2], Cos[#]} &;

Show[ParametricPlot3D[f[θ, ϕ], {θ, 0, π/4}, {ϕ, 0, π/2}], 
  Graphics3D[Sphere[f[π/8, π/8], .02]]]

or

Graphics3D[{ParametricPlot3D[f[θ, ϕ], {θ, 0, π/4}, {ϕ, 0, π/2}][[1]], 
 Sphere[f[π/8, π/8], .02]}]

both give

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.