2 # This script can be used to generate random lists of particles in the unit
3 # box 0<x<1, 0<y<1, 0<z<1, that can be used as test input to voro++. The -r
4 # switch adds extra radial information for use with the Voronoi radical
10 print "Usage: random.pl [switches] <number of particles> <filename>\n";
12 print "-h Print this information\n";
13 print "-r <max radius> Add extra radial column\n";
17 @ARGV==2 or die "Exactly two command line arguments required\n";
18 open A
,">@ARGV[1]" or die "Can't open output file";
20 foreach (1..@ARGV[0]) {
21 printf A
"$_ %f %f %f", rand(), rand(), rand();
22 printf A
" %f",$opt_r*rand() if $opt_r;