# include "addstar.h"

double airmass (double ra, double dec, double st, double latitude) {

  double hour, cosz, secz;

  /* ra, dec, latitude in dec deg; st in dec hours */

  /* hour : hour angle in degrees */
  hour = 15.0*st - ra;
  cosz = sin (RAD_DEG*dec) * sin (RAD_DEG*latitude) + cos (RAD_DEG*dec) * cos (RAD_DEG*hour) * cos (RAD_DEG*latitude);
  
  secz = 1.0 / cosz;

  return (secz);

}
