You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please correct me if my assumptions or test is incorrect.
use geo::prelude::*;use geo::point;use approx::assert_abs_diff_eq;fnmain(){// Make sure midpoint returned when at high latitudesuse geo::Geodesic;let pt_a = point!(x:0.0, y:80.0);let pt_b = point!(x:179.99, y:80.0);let ln = geo::Line::new(pt_a, pt_b);let d = Geodesic::distance(pt_a, pt_b);let midpoint = Geodesic::point_at_ratio_between(pt_a, pt_b,0.5);eprintln!("the midpoint is {:?}", midpoint);let closest_point = {let closest_res = ln.haversine_closest_point(&midpoint);use geo::Closest::*;match closest_res {Intersection(p) => p,SinglePoint(p) => p,Indeterminate => {panic!("Indeterminate");}}};assert_abs_diff_eq!(closest_point.y(), midpoint.y(), epsilon = 1e-6);assert_abs_diff_eq!(closest_point.x(), midpoint.x(), epsilon = 1e-6);}
The returned closest point is neither the input point or on the geodesic line.
again, please correct me if I've done something incorrect here.
The text was updated successfully, but these errors were encountered:
jodavaho
changed the title
Haversine closest point is in angles-as-euclidian-coordinates?
Haversine closest point is incorrect, at least at high lattitudes?
Mar 13, 2025
Please correct me if my assumptions or test is incorrect.
The returned closest point is neither the input point or on the geodesic line.
again, please correct me if I've done something incorrect here.
The text was updated successfully, but these errors were encountered: