#!/usr/bin/perl -w
use Getopt::Std;
# set default values for m and p
$m = 0.139;
$p = 1.0;
# get command line options
getopts('p:m:');
if ($opt_p) {$p = $opt_p;}
if ($opt_m) {$m = $opt_m;}
#print "p = $p, m = $m\n"; # debug debug debug
for ($lambda = 3.14159/2.0 - 0.010; $lambda > 0.0; $lambda -= 0.002) {
    $deg = 90.0 - $lambda * 180.0/3.1415926;
    print "$lambda $deg ";
    open(DATA, "echo $p $lambda $m | rezest_point_comp |");
    $line = <DATA>;
    @data = split(/\s+/, $line);
    for ($i = 0; $i <= $#data; $i++) {
	if ($data[$i]) {
	    print "$data[$i] ";
	}
    }
    close(DATA);
    print "\n";
}
exit;
