-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HaversineIntermediate trait to find intermediate points along a great circle route #230
Conversation
let y = a * lat1.cos() * lon1.sin() + b * lat2.cos() * lon2.sin(); | ||
let z = a * lat1.sin() + b * lat2.sin(); | ||
|
||
let dxy = (x.powi(2) + y.powi(2)).sqrt(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be the same as x.hypot(y)
https://docs.rs/num/0.1.42/num/trait.Float.html#tymethod.hypot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed!
Added the ability to "fill" a great circle route with intermediate points at regular interval, as described in issue #228. |
up? :) |
lgtm, thanks! bors r+ |
230: HaversineIntermediate trait to find intermediate points along a great circle route r=frewsxcv a=JivanRoquet Given two existing points, implements the ability to find intermediate points along the great circle route joining the initial points. The `haversine_intermediate` method takes three parameters: - `&self` - `other: &Point<T>` which represents the other side of the great circle route - `f: T` which represents the fraction of the route at which to put the intermediate point `f` must be included between `T::zero()` and `T::one()`. Return value is `Point<T>`. Co-authored-by: Jivan Roquet <jivan.roquet@gmail.com>
Build succeeded |
Given two existing points, implements the ability to find intermediate points along the great circle route joining the initial points.
The
haversine_intermediate
method takes three parameters:&self
other: &Point<T>
which represents the other side of the great circle routef: T
which represents the fraction of the route at which to put the intermediate pointf
must be included betweenT::zero()
andT::one()
.Return value is
Point<T>
.