geo::algorithm::rhumb

Trait RhumbIntermediate

Source
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 instead
Expand description

Returns a new Point along a rhumb line between two existing points

Required Methodsยง

Source

fn 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

Returns 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);
Source

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

Implementorsยง