Mathematical Principles for Scientific Computing and Visualization  
http://www.farinhansford.com/books/scv
by Gerald Farin and Dianne Hansford


This notebook illustrates a sphere and relates it to spherical coordinates.

A sphere of radius 1 is displayed.
Spherical coordinates are (r,theta, phi). In the Manipulate function below, you can see how changing theta moves the point along a constant latitude and changing phi moves the point along a constant longitude.

See Chapter 3: Coordinate Systems for details.

Updated May 2008

(* Output results to folder that this file lives in *)
(SetDirectory[ToFileName[Extract["FileName"/.NotebookInformation[EvaluationNotebook[]],{1},FrontEnd`FileName]]];) 

(* One way to create a sphere in Mathematica is with the primative *)
(* But we want the isoparametric lines from the parametric plot below *)
Graphics3D[Sphere[]] 


pic = ParametricPlot3D[{Cos[ϕ]Sin[θ],Sin[ϕ]Sin[θ],Cos[θ]},{ϕ,0,2π},{θ,0,π}]

Manipulate[Show[ParametricPlot3D[{Cos[ϕ]Sin[θ],Sin[ϕ]Sin[θ],Cos[θ]},{ϕ,0,2π},{θ,0,π}, Axes->False], Graphics3D[{PointSize[0.09],Point[{Cos[mytheta]Sin[myphi],Sin[mytheta]Sin[myphi],Cos[myphi]}]}]], {{myphi,Pi/2} ,0,Pi}, {{mytheta,2*Pi}, 0, 2Pi}]

(* Export["sphere_coords.eps",pic] *)