pub trait RhumbIntermediate<T: CoordFloat> {
// Required methods
fn rhumb_intermediate(&self, other: &Point<T>, f: T) -> Point<T>;
fn rhumb_intermediate_fill(
&self,
other: &Point<T>,
max_dist: T,
include_ends: bool,
) -> Vec<Point<T>>;
}
๐Deprecated since 0.29.0: Please use the
InterpolatePoint
trait insteadExpand description
Returns a new Point along a rhumb line between two existing points
Required Methodsยง
Sourcefn rhumb_intermediate(&self, other: &Point<T>, f: T) -> Point<T>
๐Deprecated since 0.29.0: Please use Rhumb::point_at_ratio_between
from the InterpolatePoint
trait instead
fn rhumb_intermediate(&self, other: &Point<T>, f: T) -> Point<T>
Rhumb::point_at_ratio_between
from the InterpolatePoint
trait insteadReturns a new Point along a rhumb line between two existing points.
ยงExamples
use geo::RhumbIntermediate;
use geo::Point;
let p1 = Point::new(10.0, 20.0);
let p2 = Point::new(125.0, 25.0);
let i20 = p1.rhumb_intermediate(&p2, 0.2);
let i50 = p1.rhumb_intermediate(&p2, 0.5);
let i80 = p1.rhumb_intermediate(&p2, 0.8);
let i20_should = Point::new(32.7, 21.0);
let i50_should = Point::new(67.0, 22.5);
let i80_should = Point::new(101.7, 24.0);
assert_relative_eq!(i20.x(), i20_should.x(), epsilon = 0.2);
assert_relative_eq!(i20.y(), i20_should.y(), epsilon = 0.2);
assert_relative_eq!(i50.x(), i50_should.x(), epsilon = 0.2);
assert_relative_eq!(i50.y(), i50_should.y(), epsilon = 0.2);
assert_relative_eq!(i80.x(), i80_should.x(), epsilon = 0.2);
assert_relative_eq!(i80.y(), i80_should.y(), epsilon = 0.2);
fn rhumb_intermediate_fill( &self, other: &Point<T>, max_dist: T, include_ends: bool, ) -> Vec<Point<T>>
๐Deprecated since 0.29.0: Please use
Rhumb::points_along_line
from the InterpolatePoint
trait instead