diff options
Diffstat (limited to 'src/math.rs')
-rw-r--r-- | src/math.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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() +} |