Use f32::hypot in Point::distance
This commit is contained in:
parent
420275793e
commit
18f016cba7
1 changed files with 1 additions and 1 deletions
|
|
@ -30,7 +30,7 @@ impl Point {
|
|||
let a = self.x - to.x;
|
||||
let b = self.y - to.y;
|
||||
|
||||
f32::sqrt(a * a + b * b)
|
||||
a.hypot(b)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue