pub struct Line<T = f64>where
T: CoordNum,{
pub start: Coord<T>,
pub end: Coord<T>,
}
Expand description
Fields§
§start: Coord<T>
§end: Coord<T>
Implementations§
Source§impl<T> Line<T>where
T: CoordNum,
impl<T> Line<T>where
T: CoordNum,
Sourcepub fn new<C>(start: C, end: C) -> Line<T>
pub fn new<C>(start: C, end: C) -> Line<T>
Creates a new line segment.
§Examples
use geo_types::{coord, Line};
let line = Line::new(coord! { x: 0., y: 0. }, coord! { x: 1., y: 2. });
assert_eq!(line.start, coord! { x: 0., y: 0. });
assert_eq!(line.end, coord! { x: 1., y: 2. });
Sourcepub fn dx(&self) -> T
pub fn dx(&self) -> T
Calculate the difference in ‘x’ components (Δx).
Equivalent to:
line.end.x - line.start.x
Sourcepub fn dy(&self) -> T
pub fn dy(&self) -> T
Calculate the difference in ‘y’ components (Δy).
Equivalent to:
line.end.y - line.start.y
Sourcepub fn slope(&self) -> T
pub fn slope(&self) -> T
Calculate the slope (Δy/Δx).
Equivalent to:
line.dy() / line.dx()
Note that:
Line::new(a, b).slope() == Line::new(b, a).slope()
Sourcepub fn determinant(&self) -> T
pub fn determinant(&self) -> T
Calculate the determinant of the line.
Equivalent to:
line.start.x * line.end.y - line.start.y * line.end.x
Note that:
Line::new(a, b).determinant() == -Line::new(b, a).determinant()
pub fn start_point(&self) -> Point<T>
pub fn end_point(&self) -> Point<T>
pub fn points(&self) -> (Point<T>, Point<T>)
Trait Implementations§
Source§impl<T> AbsDiffEq for Line<T>
impl<T> AbsDiffEq for Line<T>
Source§fn abs_diff_eq(
&self,
other: &Line<T>,
epsilon: <Line<T> as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &Line<T>, epsilon: <Line<T> as AbsDiffEq>::Epsilon, ) -> bool
Equality assertion with an absolute limit.
§Examples
use geo_types::{coord, Line};
let a = Line::new(coord! { x: 0., y: 0. }, coord! { x: 1., y: 1. });
let b = Line::new(coord! { x: 0., y: 0. }, coord! { x: 1.001, y: 1. });
approx::assert_abs_diff_eq!(a, b, epsilon=0.1);
Source§fn default_epsilon() -> <Line<T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Line<T> as AbsDiffEq>::Epsilon
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
.Source§impl<T> Area<T> for Line<T>where
T: CoordNum,
impl<T> Area<T> for Line<T>where
T: CoordNum,
fn signed_area(&self) -> T
fn unsigned_area(&self) -> T
Source§impl<T> BoundingRect<T> for Line<T>where
T: CoordNum,
impl<T> BoundingRect<T> for Line<T>where
T: CoordNum,
Source§impl<T> Centroid for Line<T>where
T: GeoFloat,
impl<T> Centroid for Line<T>where
T: GeoFloat,
Source§impl<T> ChamberlainDuquetteArea<T> for Line<T>where
T: CoordFloat,
impl<T> ChamberlainDuquetteArea<T> for Line<T>where
T: CoordFloat,
fn chamberlain_duquette_signed_area(&self) -> T
fn chamberlain_duquette_unsigned_area(&self) -> T
Source§impl<F: GeoFloat> ClosestPoint<F> for Line<F>
impl<F: GeoFloat> ClosestPoint<F> for Line<F>
Source§fn closest_point(&self, p: &Point<F>) -> Closest<F>
fn closest_point(&self, p: &Point<F>) -> Closest<F>
self
and p
.Source§impl<T> Contains<GeometryCollection<T>> for Line<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for Line<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<T> Contains<LineString<T>> for Line<T>where
T: GeoNum,
impl<T> Contains<LineString<T>> for Line<T>where
T: GeoNum,
fn contains(&self, linestring: &LineString<T>) -> bool
Source§impl<T> Contains<MultiLineString<T>> for Line<T>where
T: GeoFloat,
impl<T> Contains<MultiLineString<T>> for Line<T>where
T: GeoFloat,
fn contains(&self, target: &MultiLineString<T>) -> bool
Source§impl<T> Contains<MultiPoint<T>> for Line<T>where
T: GeoFloat,
impl<T> Contains<MultiPoint<T>> for Line<T>where
T: GeoFloat,
fn contains(&self, target: &MultiPoint<T>) -> bool
Source§impl<T> Contains<MultiPolygon<T>> for Line<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for Line<T>where
T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
Source§impl<T> CoordinatePosition for Line<T>where
T: GeoNum,
impl<T> CoordinatePosition for Line<T>where
T: GeoNum,
Source§impl<T: CoordNum> CoordsIter for Line<T>
impl<T: CoordNum> CoordsIter for Line<T>
Source§fn coords_count(&self) -> usize
fn coords_count(&self) -> usize
Return the number of coordinates in the Line
.
type Iter<'a> = Chain<Once<Coord<T>>, Once<Coord<T>>> where T: 'a
type ExteriorIter<'a> = <Line<T> as CoordsIter>::Iter<'a> where T: 'a
type Scalar = T
Source§fn coords_iter(&self) -> Self::Iter<'_>
fn coords_iter(&self) -> Self::Iter<'_>
Source§fn exterior_coords_iter(&self) -> Self::ExteriorIter<'_>
fn exterior_coords_iter(&self) -> Self::ExteriorIter<'_>
Source§impl<F: CoordFloat + FromPrimitive> Densifiable<F> for Line<F>
impl<F: CoordFloat + FromPrimitive> Densifiable<F> for Line<F>
type Output = LineString<F>
fn densify<MetricSpace>( &self, metric_space: &MetricSpace, max_segment_length: F, ) -> Self::Output
Source§impl<T> DensifyHaversine<T> for Line<T>where
T: CoordFloat + FromPrimitive,
Line<T>: HaversineLength<T>,
LineString<T>: HaversineLength<T>,
impl<T> DensifyHaversine<T> for Line<T>where
T: CoordFloat + FromPrimitive,
Line<T>: HaversineLength<T>,
LineString<T>: HaversineLength<T>,
Source§type Output = LineString<T>
type Output = LineString<T>
Haversine.densify(&line)
via the Densify
trait instead.Source§fn densify_haversine(&self, max_distance: T) -> Self::Output
fn densify_haversine(&self, max_distance: T) -> Self::Output
Haversine.densify(&line)
via the Densify
trait instead.Source§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Line<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &Line<F>> for Euclidean
Source§fn distance(
&self,
iter_geometry: &GeometryCollection<F>,
to_geometry: &Line<F>,
) -> F
fn distance( &self, iter_geometry: &GeometryCollection<F>, to_geometry: &Line<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Line<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(&self, a: &Line<F>, b: &GeometryCollection<F>) -> F
fn distance(&self, a: &Line<F>, b: &GeometryCollection<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &Line<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &Line<F>, &LineString<F>> for Euclidean
Source§fn distance(&self, line: &Line<F>, line_string: &LineString<F>) -> F
fn distance(&self, line: &Line<F>, line_string: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Line<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(&self, a: &Line<F>, b: &MultiLineString<F>) -> F
fn distance(&self, a: &Line<F>, b: &MultiLineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Line<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(&self, a: &Line<F>, b: &MultiPoint<F>) -> F
fn distance(&self, a: &Line<F>, b: &MultiPoint<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Line<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(&self, a: &Line<F>, b: &MultiPolygon<F>) -> F
fn distance(&self, a: &Line<F>, b: &MultiPolygon<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &Line<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &Line<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(&self, a: &LineString<F>, b: &Line<F>) -> F
fn distance(&self, a: &LineString<F>, b: &Line<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &MultiLineString<F>, &Line<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &MultiLineString<F>, &Line<F>> for Euclidean
Source§fn distance(
&self,
iter_geometry: &MultiLineString<F>,
to_geometry: &Line<F>,
) -> F
fn distance( &self, iter_geometry: &MultiLineString<F>, to_geometry: &Line<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &MultiPoint<F>, &Line<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &MultiPoint<F>, &Line<F>> for Euclidean
Source§fn distance(&self, iter_geometry: &MultiPoint<F>, to_geometry: &Line<F>) -> F
fn distance(&self, iter_geometry: &MultiPoint<F>, to_geometry: &Line<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &MultiPolygon<F>, &Line<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &MultiPolygon<F>, &Line<F>> for Euclidean
Source§fn distance(&self, iter_geometry: &MultiPolygon<F>, to_geometry: &Line<F>) -> F
fn distance(&self, iter_geometry: &MultiPolygon<F>, to_geometry: &Line<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<T> EuclideanDistance<T> for Line<T>
Line to Line distance
impl<T> EuclideanDistance<T> for Line<T>
Line to Line distance
Source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Coord<T>> for Line<T>where
T: GeoFloat,
impl<T> EuclideanDistance<T, Coord<T>> for Line<T>where
T: GeoFloat,
Source§fn euclidean_distance(&self, coord: &Coord<T>) -> T
👎Deprecated since 0.29.0: Please use the Euclidean.distance
method from the Distance
trait instead
fn euclidean_distance(&self, coord: &Coord<T>) -> T
Euclidean.distance
method from the Distance
trait insteadMinimum distance from a Line
to a Coord
Source§impl<T> EuclideanDistance<T, Geometry<T>> for Line<T>
impl<T> EuclideanDistance<T, Geometry<T>> for Line<T>
Source§fn euclidean_distance(&self, geom: &Geometry<T>) -> T
fn euclidean_distance(&self, geom: &Geometry<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for Line<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for Line<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for Coord<T>where
T: GeoFloat,
impl<T> EuclideanDistance<T, Line<T>> for Coord<T>where
T: GeoFloat,
Source§fn euclidean_distance(&self, line: &Line<T>) -> T
👎Deprecated since 0.29.0: Please use the Euclidean.distance
method from the Distance
trait instead
fn euclidean_distance(&self, line: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadMinimum distance from a Coord
to a Line
Source§impl<T> EuclideanDistance<T, Line<T>> for Geometry<T>
impl<T> EuclideanDistance<T, Line<T>> for Geometry<T>
Source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, Line<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &Line<T>) -> T
fn euclidean_distance(&self, target: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for LineString<T>
LineString to Line
impl<T> EuclideanDistance<T, Line<T>> for LineString<T>
LineString to Line
Source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for MultiLineString<T>
impl<T> EuclideanDistance<T, Line<T>> for MultiLineString<T>
Source§fn euclidean_distance(&self, target: &Line<T>) -> T
fn euclidean_distance(&self, target: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for MultiPoint<T>
impl<T> EuclideanDistance<T, Line<T>> for MultiPoint<T>
Source§fn euclidean_distance(&self, target: &Line<T>) -> T
fn euclidean_distance(&self, target: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for MultiPolygon<T>
impl<T> EuclideanDistance<T, Line<T>> for MultiPolygon<T>
Source§fn euclidean_distance(&self, target: &Line<T>) -> T
fn euclidean_distance(&self, target: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for Point<T>where
T: GeoFloat,
impl<T> EuclideanDistance<T, Line<T>> for Point<T>where
T: GeoFloat,
Source§fn euclidean_distance(&self, line: &Line<T>) -> T
👎Deprecated since 0.29.0: Please use the Euclidean.distance
method from the Distance
trait instead
fn euclidean_distance(&self, line: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadMinimum distance from a Line to a Point
Source§impl<T> EuclideanDistance<T, Line<T>> for Polygon<T>
impl<T> EuclideanDistance<T, Line<T>> for Polygon<T>
Source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for Rect<T>
impl<T> EuclideanDistance<T, Line<T>> for Rect<T>
Source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for Triangle<T>
impl<T> EuclideanDistance<T, Line<T>> for Triangle<T>
Source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for Line<T>
Line to LineString
impl<T> EuclideanDistance<T, LineString<T>> for Line<T>
Line to LineString
Source§fn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, MultiLineString<T>> for Line<T>
impl<T> EuclideanDistance<T, MultiLineString<T>> for Line<T>
Source§fn euclidean_distance(&self, target: &MultiLineString<T>) -> T
fn euclidean_distance(&self, target: &MultiLineString<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, MultiPoint<T>> for Line<T>
impl<T> EuclideanDistance<T, MultiPoint<T>> for Line<T>
Source§fn euclidean_distance(&self, target: &MultiPoint<T>) -> T
fn euclidean_distance(&self, target: &MultiPoint<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, MultiPolygon<T>> for Line<T>
impl<T> EuclideanDistance<T, MultiPolygon<T>> for Line<T>
Source§fn euclidean_distance(&self, target: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, target: &MultiPolygon<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Point<T>> for Line<T>where
T: GeoFloat,
impl<T> EuclideanDistance<T, Point<T>> for Line<T>where
T: GeoFloat,
Source§fn euclidean_distance(&self, point: &Point<T>) -> T
👎Deprecated since 0.29.0: Please use the Euclidean.distance
method from the Distance
trait instead
fn euclidean_distance(&self, point: &Point<T>) -> T
Euclidean.distance
method from the Distance
trait insteadMinimum distance from a Line to a Point
Source§impl<T> EuclideanDistance<T, Polygon<T>> for Line<T>
impl<T> EuclideanDistance<T, Polygon<T>> for Line<T>
Source§fn euclidean_distance(&self, other: &Polygon<T>) -> T
fn euclidean_distance(&self, other: &Polygon<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Rect<T>> for Line<T>
impl<T> EuclideanDistance<T, Rect<T>> for Line<T>
Source§fn euclidean_distance(&self, other: &Rect<T>) -> T
fn euclidean_distance(&self, other: &Rect<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Triangle<T>> for Line<T>
impl<T> EuclideanDistance<T, Triangle<T>> for Line<T>
Source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Euclidean.distance
method from the Distance
trait insteadSource§impl<T> EuclideanLength<T> for Line<T>where
T: CoordFloat,
impl<T> EuclideanLength<T> for Line<T>where
T: CoordFloat,
Source§fn euclidean_length(&self) -> T
fn euclidean_length(&self) -> T
Euclidean.length(&line)
via the Length
trait instead.Source§impl<T> From<&Line<T>> for LineString<T>where
T: CoordNum,
impl<T> From<&Line<T>> for LineString<T>where
T: CoordNum,
Source§fn from(line: &Line<T>) -> LineString<T>
fn from(line: &Line<T>) -> LineString<T>
Source§impl<T: GeoNum> From<Line<T>> for LineOrPoint<T>
Convert from a Line
ensuring end point ordering.
impl<T: GeoNum> From<Line<T>> for LineOrPoint<T>
Convert from a Line
ensuring end point ordering.
Source§impl<T> From<Line<T>> for LineString<T>where
T: CoordNum,
impl<T> From<Line<T>> for LineString<T>where
T: CoordNum,
Source§fn from(line: Line<T>) -> LineString<T>
fn from(line: Line<T>) -> LineString<T>
Source§impl GeodesicArea<f64> for Line
impl GeodesicArea<f64> for Line
Source§fn geodesic_perimeter(&self) -> f64
fn geodesic_perimeter(&self) -> f64
Source§fn geodesic_area_signed(&self) -> f64
fn geodesic_area_signed(&self) -> f64
Source§fn geodesic_area_unsigned(&self) -> f64
fn geodesic_area_unsigned(&self) -> f64
Source§impl GeodesicLength<f64> for Line
impl GeodesicLength<f64> for Line
Source§fn geodesic_length(&self) -> f64
👎Deprecated since 0.29.0: Please use the Geodesic.length(&line)
via the Length
trait instead.
fn geodesic_length(&self) -> f64
Geodesic.length(&line)
via the Length
trait instead.The units of the returned value is meters.
Source§impl<C: CoordNum> HasDimensions for Line<C>
impl<C: CoordNum> HasDimensions for Line<C>
Source§fn dimensions(&self) -> Dimensions
fn dimensions(&self) -> Dimensions
Rect
s are 2-dimensional, but it’s possible to create degenerate Rect
s which
have either 1 or 0 dimensions. Read moreSource§fn boundary_dimensions(&self) -> Dimensions
fn boundary_dimensions(&self) -> Dimensions
Geometry
’s boundary, as used by OGC-SFA. Read moreSource§impl<T> HaversineClosestPoint<T> for Line<T>where
T: GeoFloat + FromPrimitive,
impl<T> HaversineClosestPoint<T> for Line<T>where
T: GeoFloat + FromPrimitive,
fn haversine_closest_point(&self, from: &Point<T>) -> Closest<T>
Source§impl<T> HaversineLength<T> for Line<T>where
T: CoordFloat + FromPrimitive,
impl<T> HaversineLength<T> for Line<T>where
T: CoordFloat + FromPrimitive,
Source§fn haversine_length(&self) -> T
fn haversine_length(&self) -> T
Haversine.length(&line)
via the Length
trait instead.Source§impl<T> InteriorPoint for Line<T>where
T: GeoFloat,
impl<T> InteriorPoint for Line<T>where
T: GeoFloat,
Source§impl<F: CoordFloat> InterpolatableLine<F> for Line<F>
impl<F: CoordFloat> InterpolatableLine<F> for Line<F>
type Output = Point<F>
Source§fn point_at_ratio_from_start<MetricSpace: InterpolatePoint<F> + Length<F>>(
&self,
metric_space: &MetricSpace,
ratio: F,
) -> Self::Output
fn point_at_ratio_from_start<MetricSpace: InterpolatePoint<F> + Length<F>>( &self, metric_space: &MetricSpace, ratio: F, ) -> Self::Output
Source§fn point_at_ratio_from_end<MetricSpace: InterpolatePoint<F> + Length<F>>(
&self,
metric_space: &MetricSpace,
ratio: F,
) -> Self::Output
fn point_at_ratio_from_end<MetricSpace: InterpolatePoint<F> + Length<F>>( &self, metric_space: &MetricSpace, ratio: F, ) -> Self::Output
Source§fn point_at_distance_from_start<MetricSpace: InterpolatePoint<F> + Length<F>>(
&self,
metric_space: &MetricSpace,
distance: F,
) -> Self::Output
fn point_at_distance_from_start<MetricSpace: InterpolatePoint<F> + Length<F>>( &self, metric_space: &MetricSpace, distance: F, ) -> Self::Output
distance
from the start of the line. Read moreSource§fn point_at_distance_from_end<MetricSpace: InterpolatePoint<F> + Length<F>>(
&self,
metric_space: &MetricSpace,
distance: F,
) -> Self::Output
fn point_at_distance_from_end<MetricSpace: InterpolatePoint<F> + Length<F>>( &self, metric_space: &MetricSpace, distance: F, ) -> Self::Output
distance
from the end of the line. Read moreSource§impl<T> Intersects<Coord<T>> for Line<T>where
T: GeoNum,
impl<T> Intersects<Coord<T>> for Line<T>where
T: GeoNum,
fn intersects(&self, rhs: &Coord<T>) -> bool
Source§impl<T> Intersects<Geometry<T>> for Line<T>
impl<T> Intersects<Geometry<T>> for Line<T>
fn intersects(&self, rhs: &Geometry<T>) -> bool
Source§impl<T> Intersects<GeometryCollection<T>> for Line<T>
impl<T> Intersects<GeometryCollection<T>> for Line<T>
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
Source§impl<T> Intersects<Line<T>> for Coord<T>
impl<T> Intersects<Line<T>> for Coord<T>
fn intersects(&self, rhs: &Line<T>) -> bool
Source§impl<T> Intersects<Line<T>> for Polygon<T>where
T: GeoNum,
impl<T> Intersects<Line<T>> for Polygon<T>where
T: GeoNum,
fn intersects(&self, line: &Line<T>) -> bool
Source§impl<T> Intersects<Line<T>> for Rect<T>where
T: GeoNum,
impl<T> Intersects<Line<T>> for Rect<T>where
T: GeoNum,
fn intersects(&self, rhs: &Line<T>) -> bool
Source§impl<T> Intersects<Line<T>> for Triangle<T>
impl<T> Intersects<Line<T>> for Triangle<T>
fn intersects(&self, rhs: &Line<T>) -> bool
Source§impl<T> Intersects<LineString<T>> for Line<T>
impl<T> Intersects<LineString<T>> for Line<T>
fn intersects(&self, rhs: &LineString<T>) -> bool
Source§impl<T> Intersects<MultiLineString<T>> for Line<T>
impl<T> Intersects<MultiLineString<T>> for Line<T>
fn intersects(&self, rhs: &MultiLineString<T>) -> bool
Source§impl<T> Intersects<MultiPoint<T>> for Line<T>
impl<T> Intersects<MultiPoint<T>> for Line<T>
fn intersects(&self, rhs: &MultiPoint<T>) -> bool
Source§impl<T> Intersects<MultiPolygon<T>> for Line<T>
impl<T> Intersects<MultiPolygon<T>> for Line<T>
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
Source§impl<T> Intersects<Point<T>> for Line<T>
impl<T> Intersects<Point<T>> for Line<T>
fn intersects(&self, rhs: &Point<T>) -> bool
Source§impl<T> Intersects<Polygon<T>> for Line<T>
impl<T> Intersects<Polygon<T>> for Line<T>
fn intersects(&self, rhs: &Polygon<T>) -> bool
Source§impl<T> Intersects<Rect<T>> for Line<T>
impl<T> Intersects<Rect<T>> for Line<T>
fn intersects(&self, rhs: &Rect<T>) -> bool
Source§impl<T> Intersects<Triangle<T>> for Line<T>where
T: GeoNum,
impl<T> Intersects<Triangle<T>> for Line<T>where
T: GeoNum,
fn intersects(&self, rhs: &Triangle<T>) -> bool
Source§impl<T> Intersects for Line<T>where
T: GeoNum,
impl<T> Intersects for Line<T>where
T: GeoNum,
fn intersects(&self, line: &Line<T>) -> bool
Source§impl<F: CoordFloat> LengthMeasurable<F> for Line<F>
impl<F: CoordFloat> LengthMeasurable<F> for Line<F>
Source§impl<T> LineInterpolatePoint<T> for Line<T>where
T: CoordFloat,
impl<T> LineInterpolatePoint<T> for Line<T>where
T: CoordFloat,
Source§impl<T> LineLocatePoint<T, Point<T>> for Line<T>where
T: CoordFloat,
impl<T> LineLocatePoint<T, Point<T>> for Line<T>where
T: CoordFloat,
Source§impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for Line<T>
impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for Line<T>
Source§impl<T: CoordNum> MapCoordsInPlace<T> for Line<T>
impl<T: CoordNum> MapCoordsInPlace<T> for Line<T>
Source§impl<T> PointDistance for Line<T>
impl<T> PointDistance for Line<T>
Source§fn distance_2(&self, point: &Point<T>) -> T
fn distance_2(&self, point: &Point<T>) -> T
Source§fn contains_point(&self, point: &<Self::Envelope as Envelope>::Point) -> bool
fn contains_point(&self, point: &<Self::Envelope as Envelope>::Point) -> bool
true
if a point is contained within this object. Read moreSource§fn distance_2_if_less_or_equal(
&self,
point: &<Self::Envelope as Envelope>::Point,
max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar,
) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
fn distance_2_if_less_or_equal( &self, point: &<Self::Envelope as Envelope>::Point, max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar, ) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
None
if the distance
is larger than a given maximum value. Read moreSource§impl<T> RTreeObject for Line<T>
impl<T> RTreeObject for Line<T>
Source§impl<F: GeoFloat> Relate<F> for Line<F>
impl<F: GeoFloat> Relate<F> for Line<F>
Source§fn geometry_graph(&self, arg_index: usize) -> GeometryGraph<'_, F>
fn geometry_graph(&self, arg_index: usize) -> GeometryGraph<'_, F>
fn relate(&self, other: &impl Relate<F>) -> IntersectionMatrixwhere
Self: Sized,
Source§impl<T> RelativeEq for Line<T>where
T: CoordNum + RelativeEq<Epsilon = T>,
impl<T> RelativeEq for Line<T>where
T: CoordNum + RelativeEq<Epsilon = T>,
Source§fn relative_eq(
&self,
other: &Line<T>,
epsilon: <Line<T> as AbsDiffEq>::Epsilon,
max_relative: <Line<T> as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &Line<T>, epsilon: <Line<T> as AbsDiffEq>::Epsilon, max_relative: <Line<T> as AbsDiffEq>::Epsilon, ) -> bool
Equality assertion within a relative limit.
§Examples
use geo_types::{coord, Line};
let a = Line::new(coord! { x: 0., y: 0. }, coord! { x: 1., y: 1. });
let b = Line::new(coord! { x: 0., y: 0. }, coord! { x: 1.001, y: 1. });
approx::assert_relative_eq!(a, b, max_relative=0.1);
Source§fn default_max_relative() -> <Line<T> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <Line<T> as AbsDiffEq>::Epsilon
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq
.Source§impl<T: CoordNum> RemoveRepeatedPoints<T> for Line<T>
impl<T: CoordNum> RemoveRepeatedPoints<T> for Line<T>
Source§fn remove_repeated_points(&self) -> Self
fn remove_repeated_points(&self) -> Self
Source§fn remove_repeated_points_mut(&mut self)
fn remove_repeated_points_mut(&mut self)
Source§impl<T> RhumbLength<T> for Line<T>where
T: CoordFloat + FromPrimitive,
impl<T> RhumbLength<T> for Line<T>where
T: CoordFloat + FromPrimitive,
Source§fn rhumb_length(&self) -> T
fn rhumb_length(&self) -> T
Rhumb.length(&line)
via the Length
trait instead.Source§impl<T> TryFrom<Geometry<T>> for Line<T>where
T: CoordNum,
Convert a Geometry enum into its inner type.
impl<T> TryFrom<Geometry<T>> for Line<T>where
T: CoordNum,
Convert a Geometry enum into its inner type.
Fails if the enum case does not match the type you are trying to convert it to.
Source§impl<T> UlpsEq for Line<T>
impl<T> UlpsEq for Line<T>
Source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
Source§impl<F: GeoFloat> Validation for Line<F>
impl<F: GeoFloat> Validation for Line<F>
type Error = InvalidLine
Source§fn visit_validation<T>(
&self,
handle_validation_error: Box<dyn FnMut(Self::Error) -> Result<(), T> + '_>,
) -> Result<(), T>
fn visit_validation<T>( &self, handle_validation_error: Box<dyn FnMut(Self::Error) -> Result<(), T> + '_>, ) -> Result<(), T>
Source§impl<T> VincentyLength<T> for Line<T>where
T: CoordFloat + FromPrimitive,
impl<T> VincentyLength<T> for Line<T>where
T: CoordFloat + FromPrimitive,
Source§fn vincenty_length(&self) -> Result<T, FailedToConvergeError>
fn vincenty_length(&self) -> Result<T, FailedToConvergeError>
The units of the returned value is meters.
impl<T> Copy for Line<T>
impl<T> Eq for Line<T>
impl<T> StructuralPartialEq for Line<T>where
T: CoordNum,
Auto Trait Implementations§
impl<T> Freeze for Line<T>where
T: Freeze,
impl<T> RefUnwindSafe for Line<T>where
T: RefUnwindSafe,
impl<T> Send for Line<T>where
T: Send,
impl<T> Sync for Line<T>where
T: Sync,
impl<T> Unpin for Line<T>where
T: Unpin,
impl<T> UnwindSafe for Line<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T, M> AffineOps<T> for M
impl<T, M> AffineOps<T> for M
Source§fn affine_transform(&self, transform: &AffineTransform<T>) -> M
fn affine_transform(&self, transform: &AffineTransform<T>) -> M
transform
immutably, outputting a new geometry.Source§fn affine_transform_mut(&mut self, transform: &AffineTransform<T>)
fn affine_transform_mut(&mut self, transform: &AffineTransform<T>)
transform
to mutate self
.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T, G> ConvexHull<'a, T> for Gwhere
T: GeoNum,
G: CoordsIter<Scalar = T>,
impl<'a, T, G> ConvexHull<'a, T> for Gwhere
T: GeoNum,
G: CoordsIter<Scalar = T>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<'a, T, G> Extremes<'a, T> for Gwhere
G: CoordsIter<Scalar = T>,
T: CoordNum,
impl<'a, T, G> Extremes<'a, T> for Gwhere
G: CoordsIter<Scalar = T>,
T: CoordNum,
Source§impl<T, G> HausdorffDistance<T> for Gwhere
T: GeoFloat,
G: CoordsIter<Scalar = T>,
impl<T, G> HausdorffDistance<T> for Gwhere
T: GeoFloat,
G: CoordsIter<Scalar = T>,
fn hausdorff_distance<Rhs>(&self, rhs: &Rhs) -> Twhere
Rhs: CoordsIter<Scalar = T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, G> MinimumRotatedRect<T> for G
impl<T, G> MinimumRotatedRect<T> for G
type Scalar = T
fn minimum_rotated_rect( &self, ) -> Option<Polygon<<G as MinimumRotatedRect<T>>::Scalar>>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<G, IP, IR, T> Rotate<T> for G
impl<G, IP, IR, T> Rotate<T> for G
Source§fn rotate_around_centroid(&self, degrees: T) -> G
fn rotate_around_centroid(&self, degrees: T) -> G
Source§fn rotate_around_centroid_mut(&mut self, degrees: T)
fn rotate_around_centroid_mut(&mut self, degrees: T)
Self::rotate_around_centroid
Source§fn rotate_around_center(&self, degrees: T) -> G
fn rotate_around_center(&self, degrees: T) -> G
Source§fn rotate_around_center_mut(&mut self, degrees: T)
fn rotate_around_center_mut(&mut self, degrees: T)
Self::rotate_around_center
Source§fn rotate_around_point(&self, degrees: T, point: Point<T>) -> G
fn rotate_around_point(&self, degrees: T, point: Point<T>) -> G
Source§fn rotate_around_point_mut(&mut self, degrees: T, point: Point<T>)
fn rotate_around_point_mut(&mut self, degrees: T, point: Point<T>)
Self::rotate_around_point
Source§impl<T, IR, G> Scale<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
impl<T, IR, G> Scale<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
Source§fn scale(&self, scale_factor: T) -> G
fn scale(&self, scale_factor: T) -> G
Source§fn scale_xy(&self, x_factor: T, y_factor: T) -> G
fn scale_xy(&self, x_factor: T, y_factor: T) -> G
x_factor
and
y_factor
to distort the geometry’s aspect ratio. Read moreSource§fn scale_xy_mut(&mut self, x_factor: T, y_factor: T)
fn scale_xy_mut(&mut self, x_factor: T, y_factor: T)
scale_xy
.Source§fn scale_around_point(
&self,
x_factor: T,
y_factor: T,
origin: impl Into<Coord<T>>,
) -> G
fn scale_around_point( &self, x_factor: T, y_factor: T, origin: impl Into<Coord<T>>, ) -> G
origin
. Read moreSource§fn scale_around_point_mut(
&mut self,
x_factor: T,
y_factor: T,
origin: impl Into<Coord<T>>,
)
fn scale_around_point_mut( &mut self, x_factor: T, y_factor: T, origin: impl Into<Coord<T>>, )
scale_around_point
.Source§impl<T, IR, G> Skew<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
impl<T, IR, G> Skew<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
Source§fn skew(&self, degrees: T) -> G
fn skew(&self, degrees: T) -> G
Source§fn skew_xy(&self, degrees_x: T, degrees_y: T) -> G
fn skew_xy(&self, degrees_x: T, degrees_y: T) -> G
Source§fn skew_xy_mut(&mut self, degrees_x: T, degrees_y: T)
fn skew_xy_mut(&mut self, degrees_x: T, degrees_y: T)
skew_xy
.Source§fn skew_around_point(&self, xs: T, ys: T, origin: impl Into<Coord<T>>) -> G
fn skew_around_point(&self, xs: T, ys: T, origin: impl Into<Coord<T>>) -> G
origin
, sheared by an
angle along the x and y dimensions. Read moreSource§fn skew_around_point_mut(&mut self, xs: T, ys: T, origin: impl Into<Coord<T>>)
fn skew_around_point_mut(&mut self, xs: T, ys: T, origin: impl Into<Coord<T>>)
skew_around_point
.Source§impl<T, G> ToDegrees<T> for G
impl<T, G> ToDegrees<T> for G
fn to_degrees(&self) -> Self
fn to_degrees_in_place(&mut self)
Source§impl<T, G> ToRadians<T> for G
impl<T, G> ToRadians<T> for G
fn to_radians(&self) -> Self
fn to_radians_in_place(&mut self)
Source§impl<'a, T, G> TriangulateDelaunay<'a, T> for Gwhere
T: SpadeTriangulationFloat,
G: TriangulationRequirementTrait<'a, T>,
impl<'a, T, G> TriangulateDelaunay<'a, T> for Gwhere
T: SpadeTriangulationFloat,
G: TriangulationRequirementTrait<'a, T>,
Source§fn unconstrained_triangulation(&'a self) -> TriangulationResult<Triangles<T>>
fn unconstrained_triangulation(&'a self) -> TriangulationResult<Triangles<T>>
Source§fn constrained_outer_triangulation(
&'a self,
config: DelaunayTriangulationConfig<T>,
) -> TriangulationResult<Triangles<T>>
fn constrained_outer_triangulation( &'a self, config: DelaunayTriangulationConfig<T>, ) -> TriangulationResult<Triangles<T>>
Source§fn constrained_triangulation(
&'a self,
config: DelaunayTriangulationConfig<T>,
) -> TriangulationResult<Triangles<T>>
fn constrained_triangulation( &'a self, config: DelaunayTriangulationConfig<T>, ) -> TriangulationResult<Triangles<T>>
Source§impl<'a, T, G> TriangulateSpade<'a, T> for Gwhere
T: SpadeTriangulationFloat,
G: TriangulationRequirementTrait<'a, T>,
impl<'a, T, G> TriangulateSpade<'a, T> for Gwhere
T: SpadeTriangulationFloat,
G: TriangulationRequirementTrait<'a, T>,
Source§fn unconstrained_triangulation(&'a self) -> TriangulationResult<Triangles<T>>
fn unconstrained_triangulation(&'a self) -> TriangulationResult<Triangles<T>>
triangulate_delaunay
module insteadSource§fn constrained_outer_triangulation(
&'a self,
config: SpadeTriangulationConfig<T>,
) -> TriangulationResult<Triangles<T>>
fn constrained_outer_triangulation( &'a self, config: SpadeTriangulationConfig<T>, ) -> TriangulationResult<Triangles<T>>
triangulate_delaunay
module insteadSource§fn constrained_triangulation(
&'a self,
config: SpadeTriangulationConfig<T>,
) -> TriangulationResult<Triangles<T>>
fn constrained_triangulation( &'a self, config: SpadeTriangulationConfig<T>, ) -> TriangulationResult<Triangles<T>>
triangulate_delaunay
module instead