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
One interesting addition to the library would be the ability, given two distinct initial points anywhere on Earth, to compute any intermediate point located on the Great Circle path between the two initial points.
impl<T>HaversineIntermediate<T>forPoint<T>whereT:Float + Primivite{fnhaversine_intermediate(&self,other:&Point<T>,f:T) -> Point<T>{// return the intermediate point on the Great Circle between self and other// where f is the fraction along Great Circle route// (f = 0.0 returns self , f = 1.0 returns other)}}let p1 = Point::new(50.0,20.0);let p2 = Point::new(20.0,10.0);let i10 = p1.haversine_intermediate(p2,0.1);// at 10% of the way between p1 and p2let i20 = p1.haversine_intermediate(p2,0.2);// at 20% of the way between p1 and p2let i50 = p1.haversine_intermediate(p2,0.5);// halfway between p1 and p2let i0 = p1.haversine_intermediate(p2,0.0);let i100 = p1.haversine_intermediate(p2,1.0);assert_eq!(i0, p1);assert_eq!(i100, p2);
The text was updated successfully, but these errors were encountered:
JivanRoquet
changed the title
Intermediate Points on Great Circle between two Points
Intermediate points on great circle route between two Points
May 16, 2018
Feature: adding a method returning a sequence of points given a maximum distance between points.
Spec draft:
fnhaversine_intermediate_fill(&self,other:&Point<T>,max_dist:T,include_ends:bool) -> Vec<Point<T>>{// return all the waypoints between and including self and other,// so that no two consecutive waypoints are distant of more than max_dist// and pick the waypoints so that they are evenly distributed along the path}
One interesting addition to the library would be the ability, given two distinct initial points anywhere on Earth, to compute any intermediate point located on the Great Circle path between the two initial points.
Resources:
http://www.edwilliams.org/avform.htm#Intermediate
http://fraserchapman.blogspot.co.uk/2008/09/intermediate-points-on-great-circle.html
The text was updated successfully, but these errors were encountered: