added Steve K9AN's sh/moon stuff
[spider.git] / cmd / show / moon.pl
index 8013345a1407cdfd061a2f293533e646e76185d7..6203797f787ad0df1ee7ae7745f9177ac7fc5805 100644 (file)
@@ -17,6 +17,7 @@ my $f;
 my $l;
 my $n_offset;
 my @list;
+my ($rise, $set, $az, $dec, $loss, $ifrac);
 
 while ($f = shift @f){
        if(!$n_offset){
@@ -70,7 +71,7 @@ if( !$n_offset ) {
 }
 
 foreach $l (@in) {
-       my ($rise, $set, $az, $dec, $loss )=Sun::rise_set($yr,$month,$day,$hr,$min,$l->[1],$l->[2],1);
+       ($rise, $set, $az, $dec, $loss, $ifrac)=Sun::rise_set($yr,$month,$day,$hr,$min,$l->[1],$l->[2],1);
        $l->[3] =~ s{(-\d+|/\w+)$}{};
        if( !$n_offset ) {      
        push @out,sprintf("%-6.6s %-30.30s %02d/%02d/%4d %s %s %6.1f %6.1f", $l->[3], $l->[0], $day, $month, $yr, $rise, $set, $az, $dec);
@@ -78,7 +79,5 @@ foreach $l (@in) {
        push @out,sprintf("%-6.6s %-30.30s %02d/%02d/%4d %s %s", $l->[3], $l->[0], $day, $month, $yr, $rise, $set);
        }
 }
-
-                       
-
+push @out,sprintf("Illuminated fraction of the Moon's disk is %4.2f",$ifrac);
 return (1, @out);