1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// SPDX-FileCopyrightText: 2023 Angus Morrison <github@angus-morrison.com>
// SPDX-FileCopyrightText: 2023 Helge Eichhorn <git@helgeeichhorn.de>
//
// SPDX-License-Identifier: MPL-2.0
//! Useful constants for the `f64` type.
/*
* Time conversion constants
*/
/// Number of days in a Julian year.
pub const DAYS_PER_JULIAN_YEAR: f64 = 365.25;
/// Number of days in a Julian century.
pub const DAYS_PER_JULIAN_CENTURY: f64 = DAYS_PER_JULIAN_YEAR * 100.0;
/// Number of seconds in a minute.
pub const SECONDS_PER_MINUTE: f64 = 60.0;
/// Number of seconds in an hour.
pub const SECONDS_PER_HOUR: f64 = SECONDS_PER_MINUTE * 60.0;
/// Number of seconds in a day.
pub const SECONDS_PER_HALF_DAY: f64 = SECONDS_PER_HOUR * 12.0;
/// Number of seconds in a day.
pub const SECONDS_PER_DAY: f64 = SECONDS_PER_HOUR * 24.0;
/// Number of seconds in a Julian year (365.25 days).
pub const SECONDS_PER_JULIAN_YEAR: f64 = SECONDS_PER_DAY * DAYS_PER_JULIAN_YEAR;
/// Number of seconds in a Julian century.
pub const SECONDS_PER_JULIAN_CENTURY: f64 = SECONDS_PER_JULIAN_YEAR * 100.0;
/// Number of seconds in a millisecond.
pub const SECONDS_PER_MILLISECOND: f64 = 1e-3;
/// Number of seconds in a microsecond.
pub const SECONDS_PER_MICROSECOND: f64 = 1e-6;
/// Number of seconds in a nanosecond.
pub const SECONDS_PER_NANOSECOND: f64 = 1e-9;
/// Number of seconds in a picosecond.
pub const SECONDS_PER_PICOSECOND: f64 = 1e-12;
/// Number of seconds in a femtosecond.
pub const SECONDS_PER_FEMTOSECOND: f64 = 1e-15;
/// Number of seconds in an attosecond.
pub const SECONDS_PER_ATTOSECOND: f64 = 1e-18;
/*
* Julian date constants
*/
/// Modified Julian Date at J2000 epoch.
pub const MJD_J2000: f64 = 51544.5;
/// The number of seconds between the Julian Epoch and the J2000 Epoch.
pub const SECONDS_BETWEEN_JD_AND_J2000: f64 = 211813488000.0;
/// The number of seconds between the Modified Julian Epoch and the J2000 Epoch.
pub const SECONDS_BETWEEN_MJD_AND_J2000: f64 = 4453444800.0;
/// The number of seconds between the J1950 Epoch and the J2000 Epoch.
pub const SECONDS_BETWEEN_J1950_AND_J2000: f64 = 1577880000.0;
/*
* Physical constants
*/
/// Earth's rotation rate in radians per second (IERS 2010).
pub const ROTATION_RATE_EARTH: f64 = 7.2921150e-5;