tool/core/constants.rs
1// General constants
2/// Circle constant representing the ratio between circumference and radius. Equal to two times
3/// PI.
4pub const TAU: f64 = std::f64::consts::TAU;
5
6// Time related constants
7// These constants are defined in seconds, in the Earth time referential.
8/// Duration of a minute in seconds.
9pub const MINUTE: f64 = 60.0;
10/// Duration of an hour in seconds.
11pub const HOUR: f64 = MINUTE * 60.0;
12/// Duration of an Earth day in seconds.
13pub const DAY: f64 = HOUR * 24.0;
14/// Year alias for 365.25 days.
15pub const YEAR: f64 = DAY * 365.25;
16
17// Distance related constants
18// These constants are defined in meters.
19/// [Astronaumical unit](https://en.wikipedia.org/wiki/Astronomical_unit).
20pub const ASTRONAUMICAL_UNIT: f64 = 1.495978707e11;
21
22// Conversion constants
23/// Conversion from degrees to radians.
24pub const DEG2RAD: f64 = TAU / 360.0;
25/// Conversion from radians to degrees.
26pub const RAD2DEG: f64 = 360.0 / TAU;