From 87346ea9b91d441e92c476785c2cb979f9a23bf5 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Tue, 27 Feb 2018 03:36:04 -0600 Subject: -set up display for navigation system --- src/math.rs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/math.rs (limited to 'src/math.rs') diff --git a/src/math.rs b/src/math.rs new file mode 100644 index 0000000..6766a60 --- /dev/null +++ b/src/math.rs @@ -0,0 +1,3 @@ +pub fn distance(l0 : (f64, f64, f64), l1 : (f64, f64, f64)) -> f64 { + (((l1.0-l0.0).powf(2.0) + (l1.1-l0.1).powf(2.0) + (l1.2-l0.2).powf(2.0))).sqrt() +} -- cgit v1.2.3