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
pub const SUN_MASS: f64 = 1.9884e+30;
pub const SUN_RADIUS: f64 = 6.96e+8;
pub const SUN_LUMINOSITY: f64 = 3.846e+26;
pub const EARTH_MASS: f64 = 5.9726e+24;
pub const EARTH_RADIUS: f64 = 6_371_000_f64;
pub const EARTH_ATM_PRESSURE: f64 = 101_325_f64;
pub const JUPITER_MASS: f64 = 1.898e+27;
pub const JUPITER_RADIUS: f64 = 69_911_000_f64;
pub const G: f64 = 6.67428e-11;
pub const C: f64 = 299_792_458_f64;
pub const BOLTZ: f64 = 5.670373e-8;
pub const CH_LIMIT: f64 = 2.765e+30;
pub const AU: f64 = 149_597_870_700_f64;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_constants() {
assert_eq!(1.9884E+30_f64, SUN_MASS);
assert_eq!(6.96E+8_f64, SUN_RADIUS);
assert_eq!(3.846E+26_f64, SUN_LUMINOSITY);
assert_eq!(5.9726e+24_f64, EARTH_MASS);
assert_eq!(6_371_000_f64, EARTH_RADIUS);
assert_eq!(1.898e+27_f64, JUPITER_MASS);
assert_eq!(69_911_000_f64, JUPITER_RADIUS);
assert_eq!(6.67428e-11_f64, G);
assert_eq!(299_792_458_f64, C);
assert_eq!(5.670373E-8_f64, BOLTZ);
assert_eq!(2.765e+30_f64, CH_LIMIT);
assert_eq!(149_597_870_700_f64, AU);
}
}