Table of contents


NAME

RANDSP - random sphere generator

SYNOPSIS

randsp < parameter-file >sphere-file

DESCRIPTION

randsp is a generator of spheres with random positions, and optionally, random radii, which can be processed by the spheres program to produce a list of visible arcs, which sphplt in turn can plot to make a hidden-sphere image.

INPUT FILE

Input to randsp consists of one Fortran namelist group, $DATA ... $END, specifying option parameters.

When preparing namelist input, recall that Fortran requires that the dollar sign prefixing the namelist name must be placed in column 2, and column 1 is ignored.

Within the namelist group, variable assignments may occur in any order, separated by commas, with arbitrary whitespace between tokens. Variable assignments are done in order, so that in the event of multiple assignments to the same variable, the last one applies.

Defaults are always provided for all namelist variables, so that an empty namelist group is often sufficient.

The namelist variables are:

DSEED
Random number seed in the range 1 ... 2**31-2.
NSPHER
Number of spheres desired.
MODE
Set to 1 for uniform radii (default 0.05), to 2 for random radii (default 0.05), or 3 for uniform radii (default 0.05) scaled by perspective.
EYEDST
Distance of eye in front of screen (default 1.0).
RMIN, RMAX
Range of sphere radii.
XMIN, XMAX, YMIN, YMAX, ZMIN, ZMAX
Range of coordinates into which sphere centers must fall in order to be saved. Normally, these are 0.0, 1.0, 0.0, 1.0, but a smaller range may be desirable for debugging purposes.

The random number generator is invoked the same number of times in each MODE selection, so that the same set of (x,y,z,r) values will be generated in each mode. The same starting seed is used so that successively larger values of NSPHER will have common initial spheres; this can be overridden by specifying different seed values in the input.

SAMPLE INPUT FILES

This input file will generate 5 spheres of uniform radii 0.2, with initial random number seed 5.

 $DATA DSEED=5, NSPHER=5, RMIN=0.2, RMAX=0.2 $END 

This input file creates 10000 spheres in an origin-centered cube 20 units on edge, with radii randomly varying from 0.1 to 1.0.

 $DATA 
      MODE = 2,
      NSPHER = 10000,
      XMIN = -10, XMAX = 10, 
      YMIN = -10, YMAX = 10, 
      ZMIN = -10, ZMAX = 10, 
      RMIN = 0.1, RMAX = 1.0,
 $END 

SEE ALSO

plot79(1L), plot79-intro(1L), spheres(1L), sphplt(1L).

AUTHOR

Nelson H. F. Beebe, Ph.D.

Center for Scientific Computing

Department of Mathematics

220 South Physics Building

University of Utah

Salt Lake City, UT 84112

Tel: (801) 581-5254

FAX: (801) 581-4148

E-mail: <beebe@math.utah.edu>