Skip to content

Commit

Permalink
Using assert_relative_eq directly on point
Browse files Browse the repository at this point in the history
  • Loading branch information
phayes committed Mar 7, 2023
1 parent 34e962d commit ec66c94
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions geo/src/algorithm/geodesic_destination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ mod test {
fn returns_a_new_point() {
let p_1 = Point::new(9.177789688110352, 48.776781529534965);
let p_2 = p_1.geodesic_destination(45., 10000.);

let expected = Point::new(9.27411867078536, 48.8403266058781);
assert_relative_eq!(p_2.x(), expected.x(), epsilon = 1.0e-6);
assert_relative_eq!(p_2.y(), expected.y(), epsilon = 1.0e-6);

assert_relative_eq!(p_2, Point::new(9.27411867078536, 48.8403266058781), epsilon = 1.0e-6);

let distance = p_1.geodesic_distance(&p_2);
assert_relative_eq!(distance, 10000., epsilon = 1.0e-6)
Expand Down

0 comments on commit ec66c94

Please sign in to comment.