forked from shnewto/edges
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed type of size params from usize to u32
- Loading branch information
1 parent
334361c
commit 7fcb962
Showing
3 changed files
with
35 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
pub type Point = (usize, usize); | ||
pub type Point = (u32, u32); | ||
|
||
// d=√((x2-x1)²+(y2-y1)²) | ||
pub fn distance((x2, y2): Point, (x1, y1): &Point) -> f32 { | ||
((x2 as f32 - *x1 as f32).powi(2) + (y2 as f32 - *y1 as f32).powi(2)).sqrt() | ||
pub fn distance((x2, y2): Point, (x1, y1): Point) -> f32 { | ||
((x2 as f32 - x1 as f32).powi(2) + (y2 as f32 - y1 as f32).powi(2)).sqrt() | ||
} |