summaryrefslogtreecommitdiffstats
path: root/src/units.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/units.rs')
-rw-r--r--src/units.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/units.rs b/src/units.rs
new file mode 100644
index 0000000..cc04098
--- /dev/null
+++ b/src/units.rs
@@ -0,0 +1,13 @@
+use std::f64::consts::PI;
+
+pub const GRAVITATIONAL_CONSTANT : f64 = 6.67430e-11;
+pub const AU : f64 = 1.495979e11;
+
+pub type Second = u64;
+pub type Meter = f64;
+pub type Rad = f64;
+pub type Kilogram = f64;
+
+pub fn to_rad(deg : f64) -> Rad
+{ (deg / 180.0) * PI }
+