Skip to content

Commit

Permalink
fix test (and use new approx impl!)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk committed Jan 11, 2021
1 parent 48e9fae commit e32114f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions geo/src/algorithm/haversine_destination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ mod test {
fn direct_and_indirect_destinations_are_close() {
let p_1 = Point::<f64>::new(9.177789688110352, 48.776781529534965);
let p_2 = p_1.haversine_destination(45., 10000.);
let square_edge = { pow(10000., 2) / 2. }.sqrt();
let square_edge = { pow(10000., 2) / 2f64 }.sqrt();
let p_3 = p_1.haversine_destination(0., square_edge);
let p_4 = p_3.haversine_destination(90., square_edge);
assert_relative_eq!(p_4.x(), p_2.x(), epsilon = 1.0e-6);
assert_relative_eq!(p_4.y(), p_2.y(), epsilon = 1.0e-6);
assert_relative_eq!(p_4, p_2, epsilon = 1.0e-6);
}
}

0 comments on commit e32114f

Please sign in to comment.