Packinon Home > Python programs > pg_circle.py

pg_circle.py

pg_circle.py distributes points on a sphere in a series of parallel circles running from pole to pole traced by equal angular steps from the pole axis at the centre of the sphere. The points are distributed all evenly on each circle, and there are as many as can be fitted without the angle at the sphere centre between neighbours falling below the angle that separates the circles.

Put simply, it arranges balls in rings on a sphere.

I found a reference for this distribution method in the Sphere Distribution Problems page.

The program places balls on each circle starting at a line of longitude, or has an option to stagger this placement by a "half ball" on alternate circles.

This starting position means that the unstaggered distribution is symmetrical to left and right, but not front and back (which differ in regularity in both staggered and unstaggered forms).

Here are some images of 30 rings of balls on a sphere:
pg_circle.py -N 30
unstaggered, front view
pg_circle.py -N 30
unstaggered, back view
pg_circle.py -N 30 -S
staggered, front view
pg_circle.py -N 30 -S
staggered, back view
You can see how the front sides are more regular.

Program Help

usage: pg_circle.py [options]
         
options
   -h       this help message
   -N val   number of circles
   -D val   distance between circles (not implemented)
   -S       stagger balls between layers
   -o file  write output to file, if this option is not used
            the program writes to standard output.




SourceForge.net Logo Adrian Rossiter - adrian_r@teleline.es