next up previous contents
Next: Lettering Up: Representation of a sphere Previous: Spiral running from pole   Contents

Spherical Lissajous figure

Figure: Sphere represented by a Lissajous figure
\begin{figure}\begin{picture}(290,210)(-60,0)
\epsffile{fig3.eps}\end{picture}\end{figure}

A mixture of the idea of a spherical grid, which is two dimensional, and a spiral, which is one long line, consists in drawing a Lissajou figure over the spherical surface. To create a closed figure, increments in azimuth should be rational multiples of the increments in longitude, allowing the figure to close when their least common multiple has been reached.

/* geosl - represent a sphere by a lissajous figure */
/* extending from pole to pole                      */

void geosl(r0,r,a0,l,m) double *r0, r, *a0; int l, m; {
int    i, n;
double d, th, ph, dt, dp, y0, o[3][3], w[3];
y0=r0[1];
n=2048;
th=0.0;
ph=0.0;
d=6.28318/((double)n);
dt=((double)l)*d;
dp=((double)m)*d;
spheu(o,a0);
sphrv(w,r,th,ph);
sphap(w,o,w,r0);
pltms(w[0],w[2],0);
for (i=0; i<n; i++) {
  th+=dt;
  ph+=dp;
  sphrv(w,r,th,ph);
  sphap(w,o,w,r0);
  pltms(w[0],w[2],w[1]>=y0);
  }
}



Pedro Hernandez 2004-05-13