#!/usr/bin/perl
#
# Compute the area inside a Big-Dipper-Bowl-like
#   region of the sky
#
# MWR 6/10/2016

$debug = 1;

$DEGTORAD = (3.14159/180.0);

$start_dec = 55.0;
$end_dec = 60.0;
$d_dec = 0.01;

$sum = 0;
for ($dec = $start_dec; $dec < $end_dec; $dec += $d_dec) {
  $dec_rad = $dec*$DEGTORAD;
  $cosdec = cos($dec_rad);
  $width = 15.0*$cosdec;
  $height = $d_dec;
  $area = $width*$height;
 
  $sum += $area;

  if ($debug > 0) {
    printf " dec %8.3f  width %8.3f  height %8.3f  area %8.3f  sum %8.3f \n",
         $dec, $width, $height, $area, $sum;
  }
}


printf " sum is %8.3f \n", $sum;



exit 0;
