From 007bb4def33ac4291f6d5b014ab57f2c760c1e3b Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Fri, 24 Nov 2017 05:03:02 -0600 Subject: -added threaded path calculation --- src/location.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/location.rs') diff --git a/src/location.rs b/src/location.rs index a6ac623..509b551 100644 --- a/src/location.rs +++ b/src/location.rs @@ -2,6 +2,7 @@ pub struct Location(pub i32, pub i32); impl Location { + pub fn distance(&self, other: &Location) -> usize { (((self.0 - other.0).pow(2) + (self.1 - other.1).pow(2)) as f64).sqrt() as usize } -- cgit v1.2.3