pub trait InterpolatePoint<F: CoordFloat> {
// Required methods
fn point_at_distance_between(
start: Point<F>,
end: Point<F>,
distance_from_start: F,
) -> Point<F>;
fn point_at_ratio_between(
start: Point<F>,
end: Point<F>,
ratio_from_start: F,
) -> Point<F>;
fn points_along_line(
start: Point<F>,
end: Point<F>,
max_distance: F,
include_ends: bool,
) -> impl Iterator<Item = Point<F>>;
}
Expand description
Interpolate a Point
along a line between two existing points
Required Methods§
Sourcefn point_at_distance_between(
start: Point<F>,
end: Point<F>,
distance_from_start: F,
) -> Point<F>
fn point_at_distance_between( start: Point<F>, end: Point<F>, distance_from_start: F, ) -> Point<F>
Returns a new Point along a line between two existing points.
See specific implementations for details.
Sourcefn point_at_ratio_between(
start: Point<F>,
end: Point<F>,
ratio_from_start: F,
) -> Point<F>
fn point_at_ratio_between( start: Point<F>, end: Point<F>, ratio_from_start: F, ) -> Point<F>
Returns a new Point along a line between two existing points.
See specific implementations for details.
Sourcefn points_along_line(
start: Point<F>,
end: Point<F>,
max_distance: F,
include_ends: bool,
) -> impl Iterator<Item = Point<F>>
fn points_along_line( start: Point<F>, end: Point<F>, max_distance: F, include_ends: bool, ) -> impl Iterator<Item = Point<F>>
Interpolates Point
s along a line between start
and end
.
See specific implementations for details.
As many points as necessary will be added such that the distance between points
never exceeds max_distance
. If the distance between start and end is less than
max_distance
, no additional points will be included in the output.
include_ends
: Should the start and end points be included in the output?
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl InterpolatePoint<f64> for Geodesic
Interpolate Point(s) along a geodesic line.
impl<F: CoordFloat + FromPrimitive> InterpolatePoint<F> for Euclidean
Interpolate Point(s) along a line on the Euclidean plane.
impl<F: CoordFloat + FromPrimitive> InterpolatePoint<F> for Haversine
Interpolate Point(s) along a great circle.
impl<F: CoordFloat + FromPrimitive> InterpolatePoint<F> for Rhumb
Interpolate Point(s) along a rhumb line.