Use f32::hypot
in Point::distance
This commit is contained in:
parent
420275793e
commit
18f016cba7
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user