rfa 0.5.9

A port ERFA to Rust.
Documentation
 //! This module contain all API constants as in erfam.h or sofam.h. Also macros from these files, 
 //! have been portrayed as functions.


use std::f64::consts::*;
/// Pi 
pub const URSA_DPI: f64 = PI;

/// 2Pi 
pub const URSA_D2PI: f64 = TAU;

/// Radians to degrees 
pub const URSA_DR2D: f64 = 57.29577951308232087679815;

/// Degrees to radians 
pub const URSA_DD2R: f64 = 1.745329251994329576923691e-2;

/// Radians to arcseconds 
pub const URSA_DR2AS: f64 = 206264.8062470963551564734;

/// Arcseconds to radians 
pub const URSA_DAS2R: f64 = 4.848136811095359935899141e-6;

/// Seconds of time to radians 
pub const URSA_DS2R: f64 = 7.272205216643039903848712e-5;

/// Arcseconds in a full circle 
pub const URSA_TURNAS: f64 = 1296000.0;

/// Milliarcseconds to radians 
pub const URSA_DMAS2R: f64 = URSA_DAS2R / 1e3;

/// Length of tropical year B1900: f64 = days; 
pub const URSA_DTY: f64 = 365.242198781;

/// Seconds per day. 
pub const URSA_DAYSEC: f64 = 86400.0;

/// Days per Julian year 
pub const URSA_DJY: f64 = 365.25;

/// Days per Julian century 
pub const URSA_DJC: f64 = 36525.0;

/// Days per Julian millennium 
pub const URSA_DJM: f64 = 365250.0;

/// Reference epoch: f64 = J2000.0;, Julian Date 
pub const URSA_DJ00: f64 = 2451545.0;

/// Julian Date of Modified Julian Date zero 
pub const URSA_DJM0: f64 = 2400000.5;

/// Reference epoch: f64 = J2000.0;, Modified Julian Date 
pub const URSA_DJM00: f64 = 51544.5;

/// 1977 Jan 1.0 as MJD 
pub const URSA_DJM77: f64 = 43144.0;

/// TT minus TAI (s)
pub const URSA_TTMTAI: f64 = 32.184;

/// Astronomical unit (m, IAU 2012) 
pub const URSA_DAU: f64 = 149597870.7e3;

//// Speed of light (m/s) 
pub const URSA_CMPS: f64 = 299792458.0;

/// Light time for 1 au (s) 
pub const URSA_AULT: f64 = URSA_DAU/URSA_CMPS;

/// Speed of light (au per day) 
pub const URSA_DC: f64 = URSA_DAYSEC/URSA_AULT;

/// L_G = 1 - d(TT)/d(TCG) 
pub const URSA_ELG: f64 = 6.969290134e-10;

/// L_B = 1 - d(TDB)/d(TCB), and TDB (s) at TAI 1977/1/1.0 
pub const URSA_ELB: f64 = 1.550519768e-8;
pub const URSA_TDB0: f64 = -6.55e-5;

/// Schwarzschild radius of the Sun (au) 
/// = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 
pub const URSA_SRS: f64 = 1.97412574336e-8;

/// URSA_DINT- truncate to nearest whole number towards zero (double) 
pub fn ursa_dint(a: f64)->f64 { if a<0.0{a.ceil()}else{ a.floor()} }

/// URSA_DNINT(A) - round to nearest whole number (double) 
pub fn ursa_dnint(a: f64)->f64{ if a.abs()<0.5 {0.0}
                                else if a < 0.0 {(a-0.5).ceil()} else {(a+0.5).floor()} } 

/// URSA_DSIGN(A,B) - magnitude of A with sign of B (double) 
pub fn ursa_dsign(a: f64, b: f64)->f64{ if b<0.0{-a.abs()} else { a.abs() } }

/// max(A,B) - larger (most +ve) of two numbers (generic) 
pub fn ursa_gmax(a: f64,b: f64)->f64{a.max(b)}

/// min(A,B) - smaller (least +ve) of two numbers (generic) 
pub fn ursa_gmin(a: f64, b: f64)->f64{a.min(b)}

/// Reference ellipsoids 
pub const URSA_WGS84: i8 = 1;
pub const URSA_GRS80: i8 = 2;
pub const URSA_WGS72: i8 = 3;