Graphing Implicit Curves on the Riemann Sphere

Djilali Benayat

This is a companion notebook to the feature article “Graphing on the Riemann Sphere.” It deals with drawing the solution curves of implicit equations on the sphere (S^2). We use the built-in ContourPlot to generate the points of the curve. Then using the InputForm we isolate the different branches and map them to the sphere. The  spherical curve is generally better (i.e., more accurate and faithful) than the  curve obtained from ContourPlot when the window [a,b]×[c,d] is very large.

The mapping μ : (ℝ^2) →  (𝕊^2)

μ[{u_,v_}]:=With[{s=4+u^2+v^2},{8-s,4 u,4 v}/s]

The sphere with variable opacity, the equator, two meridians, the blue origin and the red point at infinity ω

sphere[n_]:=Graphics3D[{Yellow,Opacity[n],Sphere[{0,0,0},0.985]}];

equator=Graphics3D[{Thickness[0.003`],Blue,First[ParametricPlot3D[{Cos[p],Sin[p],0},{p,0,2 π},PlotPoints->100]]}];

meridian1=Graphics3D[{Thickness[0.003`],Green,First[ParametricPlot3D[{Cos[p],0,Sin[p]},{p,0,2 π},PlotPoints->100]]}];

meridian2=Graphics3D[{Thickness[0.003`],Cyan,First[ParametricPlot3D[{0,Cos[p],Sin[p]},{p,0,2 π},PlotPoints->100]]}];

zero=Graphics3D[{Blue,Sphere[{1,0,0},0.03]}];

ω=Graphics3D[{Red,Sphere[{-1,0,0},0.03]}];  (* the point at infinity *)

Your function implfunc[x,y]

Clear[implfunc];
implfunc[x_,y_]:=(y^2)-((x^3)-10x+3);

We extract the different branches of the implicit curve "implfunc[x,y]==0"

plot=InputForm[ContourPlot[implfunc[x,y]==0,{x,-500,500},{y,-500,500},PlotPoints->200]];

plot1=Cases[plot/.{u_Real,v_Real}->μ[{u,v}],{x_Real,y_Real,z_Real},Infinity];

maxes=Cases[plot,_Line,Infinity]/.Line->Max;

branchnumber =Length[maxes];

maxes[[0]]=0;
branch[n_Integer]:=Graphics3D[{Thickness[0.005],Black,Line[Take[plot1,{maxes[[n-1]]+1,maxes[[n]]}]]}];

Everything is assembled

curve[op_]:=Show[Join[{sphere[op],equator,meridian1,meridian2,zero,ω},Table[branch[m],{m,branchnumber}]],Boxed->False,ImageSize->500];

Example:  Elliptic curve with two branches

curve[0.75]

Main Article

GraphingOnSphere.nb

Available at www.mathematica-journal.com/2008/11/graphing-on-the-riemann-sphere/.