next up previous contents
Next: Sphere Lattices Up: geom Previous: Ferrocene molecule   Contents

Random spheres

Figure: 27 Spheres, all of whose parameters were chosen at random.
\begin{figure}\begin{picture}(300,300)(-40,0)
\epsffile{fig18.eps}\end{picture}\end{figure}

Interesting artistic effects can be produced by simply generating a collection of spheres with random parameters. More subtle variations of the same effect would arise from varying the probability distributions, or even giving them a spatial dependence.

 
/* Generate a random assortment of n atoms */

void molra(s,n) double s[][7]; int n; {int i;
for (i=0; i<n; i++){
  s[i][0]=((double)(rand()%4096))/1024.0-2.0;
  s[i][1]=((double)(rand()%4096))/1024.0-2.0;
  s[i][2]=((double)(rand()%4096))/1024.0-2.0;
  s[i][3]=((double)(rand()%4096))/4096.0+0.1;
  s[i][4]=(((double)(rand()%4096))/4096.0)*180.0;
  s[i][5]=(((double)(rand()%4096))/4096.0)*180.0;
  s[i][6]=(((double)(rand()%4096))/4096.0)*180.0;
  }
}



Pedro Hernandez 2004-05-13