OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ias_geo_find_sec.c
Go to the documentation of this file.
1 /****************************************************************************
2 NAME: ias_geo_find_sec
3 
4 PURPOSE: Extracts sec portions of an angle.
5 
6 RETURNS: void
7 
8 ALGORITHM DESCRIPTION:
9  Extract seconds portion of angle
10  Return
11 
12 *****************************************************************************/
13 #include <math.h>
14 #include "ias_geo.h"
15 
16 void ias_geo_find_sec
17 (
18  double angle, /* I: Angle in total degrees */
19  double *second /* O: Second portion of the angle */
20 )
21 {
22  int temp_sec;
23 
24  *second = fabs(angle);
25  *second -= (int)(*second);
26  *second *= 60.0;
27  *second -= (int)(*second);
28  *second *= 60.0;
29  if (*second > 60.0)
30  *second -= 60.0;
31  temp_sec = (int) (*second * 1000); /* Truncate to 0.001 sec */
32  *second = temp_sec / 1000.0;
33 }
void ias_geo_find_sec(double angle, double *second)
#define fabs(a)
Definition: misc.h:93