Functions
math_util.c File Reference

This file contains mathematical utility functions. More...

#include <math.h>
#include <stdlib.h>
#include "aephem.h"

Functions

double ae_mod_360 (double x)
 Reduce x modulo 360 degrees. More...
 
double ae_mod_180 (double x)
 Reduce x modulo 360 degrees, but centre at 0 degrees. More...
 
double ae_mod_2pi (double x)
 Reduce x modulo 2 pi. More...
 
double ae_zatan2 (double x, double y)
 Quadrant correct inverse circular tangent. More...
 

Detailed Description

This file contains mathematical utility functions.

Function Documentation

double ae_mod_180 ( double  x)

Reduce x modulo 360 degrees, but centre at 0 degrees.

Parameters
xThe number to be modulo'd.
Returns
A number in the range (-180: 180].

References ae_mod_360().

Referenced by ae_subobs_point().

double ae_mod_2pi ( double  x)

Reduce x modulo 2 pi.

Parameters
xThe number to be modulo'd.
Returns
The number in the range [0: 2 pi].

Referenced by ae_kepler().

double ae_mod_360 ( double  x)

Reduce x modulo 360 degrees.

Parameters
xThe number to be modulo'd.
Returns
A number in the range [0: 360.0].

Referenced by ae_altaz_to_radec(), ae_gal_to_radec(), ae_gast(), ae_gmst(), ae_kepler(), ae_last(), ae_lmst(), ae_mod_180(), ae_phys_pole(), ae_radec_to_gal(), and ae_subobs_point().

double ae_zatan2 ( double  x,
double  y 
)

Quadrant correct inverse circular tangent.

Returns radian angle between 0 and +2PI whose tangent is y/x.

Cephes Math Library Release 2.0: April, 1987 Copyright 1984, 1987 by Stephen L. Moshier. Direct inquiries to 30 Frost Street, Cambridge, MA 02140 Certain routines from the Library, including this one, may be used and distributed freely provided this notice is retained and source code is included with all distributions.

Parameters
xThe denominator.
yThe numerator.
Returns
The quadrant correct inverse circular tangent.

Referenced by ae_altaz_to_radec(), ae_delta_q(), ae_diurnal_parallax(), ae_fk4_to_fk5(), ae_kepler(), ae_radec_to_altaz(), ae_rect_to_polar(), ae_rect_to_polar_with_jd(), and ae_subobs_point().