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
/// Solar system bodies
///
/// Coordinate origin is the solar system barycenter
///
/// # Notes:
/// * For native JPL Ephemerides function calls:
/// positions for all bodies are natively relative to
/// solar system barycenter, with exception of moon,
/// which is computed in Geocentric system
/// * EMB (2) is the Earth-Moon barycenter
/// * The sun position is relative to the solar system barycenter
/// (it will be close to origin)
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SolarSystem {
/// Mercury
Mercury = 0,
/// Venus
Venus = 1,
/// Earth-Moon Barycenter
EMB = 2,
/// Mars
Mars = 3,
/// Jupiter
Jupiter = 4,
/// Saturn
Saturn = 5,
/// Uranus
Uranus = 6,
/// Neptune
Neptune = 7,
/// Pluto
Pluto = 8,
/// Moon (Geocentric)
Moon = 9,
/// Sun
Sun = 10,
}
impl std::fmt::Display for SolarSystem {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
let name = match self {
Self::Mercury => "Mercury",
Self::Venus => "Venus",
Self::EMB => "Earth-Moon Barycenter",
Self::Mars => "Mars",
Self::Jupiter => "Jupiter",
Self::Saturn => "Saturn",
Self::Uranus => "Uranus",
Self::Neptune => "Neptune",
Self::Pluto => "Pluto",
Self::Moon => "Moon",
Self::Sun => "Sun",
};
write!(f, "{}", name)
}
}