Skip to main content

sofars/
consts.rs

1//! Constants
2#![allow(dead_code)]
3/// Pi
4pub const DPI: f64 = 3.141592653589793238462643;
5
6/// 2Pi
7pub const D2PI: f64 = 6.283185307179586476925287;
8
9/// Radians to degrees
10pub const DR2D: f64 = 57.29577951308232087679815;
11
12/// Degrees to radians
13pub const DD2R: f64 = 1.745329251994329576923691e-2;
14
15/// Radians to arcseconds
16pub const DR2AS: f64 = 206264.8062470963551564734;
17
18/// Arcseconds to radians
19pub const DAS2R: f64 = 4.848136811095359935899141e-6;
20
21/// Seconds of time to radians
22pub const DS2R: f64 = 7.272205216643039903848712e-5;
23
24/// Arcseconds in a full circle
25pub const TURNAS: f64 = 1296000.0;
26
27/// Milliarcseconds to radians
28pub const DMAS2R: f64 = DAS2R / 1e3;
29
30/// Length of tropical year B1900 (days)
31pub const DTY: f64 = 365.242198781;
32
33/// Seconds per day
34pub const DAYSEC: f64 = 86400.0;
35
36/// Days per Julian year
37pub const DJY: f64 = 365.25;
38
39/// Days per Julian century
40pub const DJC: f64 = 36525.0;
41
42/// Days per Julian millennium
43pub const DJM: f64 = 365250.0;
44
45/// Reference epoch (J2000.0), Julian Date
46pub const DJ00: f64 = 2451545.0;
47
48/// Julian Date of Modified Julian Date zero
49pub const DJM0: f64 = 2400000.5;
50
51/// Reference epoch (J2000.0), Modified Julian Date
52pub const DJM00: f64 = 51544.5;
53
54/// 1977 Jan 1.0 as MJD
55pub const DJM77: f64 = 43144.0;
56
57/// TT minus TAI (s)
58pub const TTMTAI: f64 = 32.184;
59
60/// Astronomical unit (m, IAU 2012)
61pub const DAU: f64 = 149597870.7e3;
62
63/// Speed of light (m/s)
64pub const CMPS: f64 = 299792458.0;
65
66/// Light time for 1 au (s)
67pub const AULT: f64 = DAU / CMPS;
68
69/// Speed of light (au per day)
70pub const DC: f64 = DAYSEC / AULT;
71
72/// L_G = 1 - d(TT)/d(TCG)
73pub const ELG: f64 = 6.969290134e-10;
74
75/// L_B = 1 - d(TDB)/d(TCB), and TDB (s) at TAI 1977/1/1.0
76pub const ELB: f64 = 1.550519768e-8;
77pub const TDB0: f64 = -6.55e-5;
78
79/// Schwarzschild radius of the Sun (au)
80pub const SRS: f64 = 1.97412574336e-8;
81
82/// Reference ellipsoids
83pub const WGS84: i32 = 1;
84pub const GRS80: i32 = 2;
85pub const WGS72: i32 = 3;
86
87/// Earliest year allowed (4800BC)
88pub const IYMIN: i32 = -4799;
89
90/// Month lengths in days
91pub const MTAB: [i32; 12] = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
92
93/// J2000.0-B1900.0 (2415019.81352) in days
94pub const D1900: f64 = 36524.68648;