Use f32::hypot in Point::distance

This commit is contained in:
Héctor Ramón Jiménez 2020-03-20 04:08:18 +01:00
parent 420275793e
commit 18f016cba7

View File

@ -30,7 +30,7 @@ impl Point {
let a = self.x - to.x; let a = self.x - to.x;
let b = self.y - to.y; let b = self.y - to.y;
f32::sqrt(a * a + b * b) a.hypot(b)
} }
} }