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>where
C: Into<Coord<T>>,
pub fn new<C>(start: C, end: C) -> Line<T>where C: Into<Coord<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<Line<T>> for Line<T>where
T: AbsDiffEq<T, Epsilon = T> + CoordNum,
impl<T> AbsDiffEq<Line<T>> for Line<T>where T: AbsDiffEq<T, Epsilon = T> + CoordNum,
source§fn abs_diff_eq(
&self,
other: &Line<T>,
epsilon: <Line<T> as AbsDiffEq<Line<T>>>::Epsilon
) -> bool
fn abs_diff_eq( &self, other: &Line<T>, epsilon: <Line<T> as AbsDiffEq<Line<T>>>::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<Line<T>>>::Epsilon
fn default_epsilon() -> <Line<T> as AbsDiffEq<Line<T>>>::Epsilon
§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> 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, Point<F>> for Line<F>
impl<F: GeoFloat> ClosestPoint<F, Point<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<'a, T: CoordNum> CoordsIter<'a> for Line<T>
impl<'a, T: CoordNum> CoordsIter<'a> for Line<T>
source§fn coords_count(&'a self) -> usize
fn coords_count(&'a self) -> usize
Return the number of coordinates in the Line
.
type Iter = Chain<Once<Coord<T>>, Once<Coord<T>>>
type ExteriorIter = <Line<T> as CoordsIter<'a>>::Iter
type Scalar = T
source§fn coords_iter(&'a self) -> Self::Iter
fn coords_iter(&'a self) -> Self::Iter
source§fn exterior_coords_iter(&'a self) -> Self::ExteriorIter
fn exterior_coords_iter(&'a self) -> Self::ExteriorIter
source§impl<T> Densify<T> for Line<T>where
T: CoordFloat,
Line<T>: EuclideanLength<T>,
LineString<T>: EuclideanLength<T>,
impl<T> Densify<T> for Line<T>where T: CoordFloat, Line<T>: EuclideanLength<T>, LineString<T>: EuclideanLength<T>,
source§impl<'de, T> Deserialize<'de> for Line<T>where
T: CoordNum + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Line<T>where T: CoordNum + Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Line<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Line<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§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
fn euclidean_distance(&self, coord: &Coord<T>) -> T
Minimum distance from a Line
to a Coord
source§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
fn euclidean_distance(&self, line: &Line<T>) -> T
Minimum distance from a Coord
to a Line
source§impl<T> EuclideanDistance<T, Line<T>> for Line<T>where
T: GeoFloat + FloatConst + Signed + RTreeNum,
impl<T> EuclideanDistance<T, Line<T>> for Line<T>where T: GeoFloat + FloatConst + Signed + RTreeNum,
Line to Line distance
source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
source§impl<T> EuclideanDistance<T, Line<T>> for LineString<T>where
T: GeoFloat + FloatConst + Signed + RTreeNum,
impl<T> EuclideanDistance<T, Line<T>> for LineString<T>where T: GeoFloat + FloatConst + Signed + RTreeNum,
LineString to Line
source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
source§impl<T> EuclideanDistance<T, Line<T>> for MultiPolygon<T>where
T: GeoFloat + FloatConst + Signed + RTreeNum,
impl<T> EuclideanDistance<T, Line<T>> for MultiPolygon<T>where T: GeoFloat + FloatConst + Signed + RTreeNum,
MultiPolygon to Line distance
source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
source§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
fn euclidean_distance(&self, line: &Line<T>) -> T
Minimum distance from a Line to a Point
source§impl<T> EuclideanDistance<T, Line<T>> for Polygon<T>where
T: GeoFloat + FloatConst + Signed + RTreeNum,
impl<T> EuclideanDistance<T, Line<T>> for Polygon<T>where T: GeoFloat + FloatConst + Signed + RTreeNum,
source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
source§impl<T> EuclideanDistance<T, LineString<T>> for Line<T>where
T: GeoFloat + FloatConst + Signed + RTreeNum,
impl<T> EuclideanDistance<T, LineString<T>> for Line<T>where T: GeoFloat + FloatConst + Signed + RTreeNum,
Line to LineString
source§fn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
source§impl<T> EuclideanDistance<T, MultiPolygon<T>> for Line<T>where
T: GeoFloat + FloatConst + Signed + RTreeNum,
impl<T> EuclideanDistance<T, MultiPolygon<T>> for Line<T>where T: GeoFloat + FloatConst + Signed + RTreeNum,
Line to MultiPolygon distance
source§fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
source§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
fn euclidean_distance(&self, point: &Point<T>) -> T
Minimum distance from a Line to a Point
source§impl<T> EuclideanDistance<T, Polygon<T>> for Line<T>where
T: GeoFloat + Signed + RTreeNum + FloatConst,
impl<T> EuclideanDistance<T, Polygon<T>> for Line<T>where T: GeoFloat + Signed + RTreeNum + FloatConst,
source§fn euclidean_distance(&self, other: &Polygon<T>) -> T
fn euclidean_distance(&self, other: &Polygon<T>) -> T
source§impl<T> EuclideanLength<T, Line<T>> for Line<T>where
T: CoordFloat,
impl<T> EuclideanLength<T, Line<T>> for Line<T>where T: CoordFloat,
source§fn euclidean_length(&self) -> T
fn euclidean_length(&self) -> T
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>
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, Line<f64>> for Line
impl GeodesicLength<f64, Line<f64>> for Line
source§fn geodesic_length(&self) -> f64
fn geodesic_length(&self) -> f64
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> HaversineLength<T, Line<T>> for Line<T>where
T: CoordFloat + FromPrimitive,
impl<T> HaversineLength<T, Line<T>> for Line<T>where T: CoordFloat + FromPrimitive,
source§fn haversine_length(&self) -> T
fn haversine_length(&self) -> T
source§impl<T> InteriorPoint for Line<T>where
T: GeoFloat,
impl<T> InteriorPoint for Line<T>where T: GeoFloat,
source§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>where
Geometry<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<Geometry<T>> for Line<T>where Geometry<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &Geometry<T>) -> bool
source§impl<T> Intersects<GeometryCollection<T>> for Line<T>where
GeometryCollection<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<GeometryCollection<T>> for Line<T>where GeometryCollection<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &GeometryCollection<T>) -> bool
source§impl<T> Intersects<Line<T>> for Coord<T>where
Line<T>: Intersects<Coord<T>>,
T: CoordNum,
impl<T> Intersects<Line<T>> for Coord<T>where Line<T>: Intersects<Coord<T>>, T: CoordNum,
fn intersects(&self, rhs: &Line<T>) -> bool
source§impl<T> Intersects<Line<T>> for Line<T>where
T: GeoNum,
impl<T> Intersects<Line<T>> for Line<T>where T: GeoNum,
fn intersects(&self, line: &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<LineString<T>> for Line<T>where
LineString<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<LineString<T>> for Line<T>where LineString<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &LineString<T>) -> bool
source§impl<T> Intersects<MultiLineString<T>> for Line<T>where
MultiLineString<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<MultiLineString<T>> for Line<T>where MultiLineString<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &MultiLineString<T>) -> bool
source§impl<T> Intersects<MultiPoint<T>> for Line<T>where
MultiPoint<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<MultiPoint<T>> for Line<T>where MultiPoint<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &MultiPoint<T>) -> bool
source§impl<T> Intersects<MultiPolygon<T>> for Line<T>where
MultiPolygon<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<MultiPolygon<T>> for Line<T>where MultiPolygon<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
source§impl<T> Intersects<Point<T>> for Line<T>where
Point<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<Point<T>> for Line<T>where Point<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &Point<T>) -> bool
source§impl<T> Intersects<Polygon<T>> for Line<T>where
Polygon<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<Polygon<T>> for Line<T>where Polygon<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &Polygon<T>) -> bool
source§impl<T> Intersects<Rect<T>> for Line<T>where
Rect<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<Rect<T>> for Line<T>where Rect<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &Rect<T>) -> bool
source§impl<T> Intersects<Triangle<T>> for Line<T>where
Triangle<T>: Intersects<Line<T>>,
T: CoordNum,
impl<T> Intersects<Triangle<T>> for Line<T>where Triangle<T>: Intersects<Line<T>>, T: CoordNum,
fn intersects(&self, rhs: &Triangle<T>) -> bool
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> PartialEq<Line<T>> for Line<T>where
T: PartialEq<T> + CoordNum,
impl<T> PartialEq<Line<T>> for Line<T>where T: PartialEq<T> + CoordNum,
source§impl<T> PointDistance for Line<T>where
T: Float + RTreeNum,
impl<T> PointDistance for Line<T>where T: Float + RTreeNum,
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<F: GeoFloat> Relate<F, GeometryCollection<F>> for Line<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Line<F>
fn relate(&self, other: &GeometryCollection<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, Line<F>> for GeometryCollection<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for Line<F>
impl<F: GeoFloat> Relate<F, Line<F>> for Line<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for LineString<F>
impl<F: GeoFloat> Relate<F, Line<F>> for LineString<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for MultiLineString<F>
impl<F: GeoFloat> Relate<F, Line<F>> for MultiLineString<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for MultiPoint<F>
impl<F: GeoFloat> Relate<F, Line<F>> for MultiPoint<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, Line<F>> for MultiPolygon<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for Point<F>
impl<F: GeoFloat> Relate<F, Line<F>> for Point<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for Polygon<F>
impl<F: GeoFloat> Relate<F, Line<F>> for Polygon<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for Rect<F>
impl<F: GeoFloat> Relate<F, Line<F>> for Rect<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Line<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, Line<F>> for Triangle<F>
fn relate(&self, other: &Line<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, LineString<F>> for Line<F>
impl<F: GeoFloat> Relate<F, LineString<F>> for Line<F>
fn relate(&self, other: &LineString<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, MultiLineString<F>> for Line<F>
impl<F: GeoFloat> Relate<F, MultiLineString<F>> for Line<F>
fn relate(&self, other: &MultiLineString<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, MultiPoint<F>> for Line<F>
impl<F: GeoFloat> Relate<F, MultiPoint<F>> for Line<F>
fn relate(&self, other: &MultiPoint<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Line<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Line<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Point<F>> for Line<F>
impl<F: GeoFloat> Relate<F, Point<F>> for Line<F>
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Polygon<F>> for Line<F>
impl<F: GeoFloat> Relate<F, Polygon<F>> for Line<F>
fn relate(&self, other: &Polygon<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Rect<F>> for Line<F>
impl<F: GeoFloat> Relate<F, Rect<F>> for Line<F>
fn relate(&self, other: &Rect<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Triangle<F>> for Line<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for Line<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
source§impl<T> RelativeEq<Line<T>> for Line<T>where
T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
impl<T> RelativeEq<Line<T>> for Line<T>where T: AbsDiffEq<T, Epsilon = T> + CoordNum + RelativeEq<T>,
source§fn relative_eq(
&self,
other: &Line<T>,
epsilon: <Line<T> as AbsDiffEq<Line<T>>>::Epsilon,
max_relative: <Line<T> as AbsDiffEq<Line<T>>>::Epsilon
) -> bool
fn relative_eq( &self, other: &Line<T>, epsilon: <Line<T> as AbsDiffEq<Line<T>>>::Epsilon, max_relative: <Line<T> as AbsDiffEq<Line<T>>>::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<Line<T>>>::Epsilon
fn default_max_relative() -> <Line<T> as AbsDiffEq<Line<T>>>::Epsilon
§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> RemoveRepeatedPoints<T> for Line<T>where
T: CoordNum + FromPrimitive,
impl<T> RemoveRepeatedPoints<T> for Line<T>where T: CoordNum + FromPrimitive,
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> Serialize for Line<T>where
T: CoordNum + Serialize,
impl<T> Serialize for Line<T>where T: CoordNum + Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
source§impl<T> TryFrom<Geometry<T>> for Line<T>where
T: CoordNum,
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> VincentyLength<T, Line<T>> for Line<T>where
T: CoordFloat + FromPrimitive,
impl<T> VincentyLength<T, Line<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>where T: Copy + CoordNum,
impl<T> Eq for Line<T>where T: Eq + CoordNum,
impl<T> StructuralEq for Line<T>where T: CoordNum,
impl<T> StructuralPartialEq for Line<T>where T: CoordNum,
Auto Trait Implementations§
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 Mwhere
T: CoordNum,
M: MapCoordsInPlace<T> + MapCoords<T, T, Output = M>,
impl<T, M> AffineOps<T> for Mwhere T: CoordNum, M: MapCoordsInPlace<T> + MapCoords<T, T, Output = 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<G, T, U> Convert<T, U> for Gwhere
T: CoordNum,
U: CoordNum + From<T>,
G: MapCoords<T, U>,
impl<G, T, U> Convert<T, U> for Gwhere T: CoordNum, U: CoordNum + From<T>, G: MapCoords<T, U>,
source§impl<'a, T, G> ConvexHull<'a, T> for Gwhere
T: GeoNum,
G: CoordsIter<'a, Scalar = T>,
impl<'a, T, G> ConvexHull<'a, T> for Gwhere T: GeoNum, G: CoordsIter<'a, Scalar = T>,
source§impl<'a, T, G> Extremes<'a, T> for Gwhere
G: CoordsIter<'a, Scalar = T>,
T: CoordNum,
impl<'a, T, G> Extremes<'a, T> for Gwhere G: CoordsIter<'a, Scalar = T>, T: CoordNum,
source§impl<'a, T, G> MinimumRotatedRect<'a, T> for Gwhere
T: CoordFloat + GeoFloat + GeoNum,
G: CoordsIter<'a, Scalar = T>,
impl<'a, T, G> MinimumRotatedRect<'a, T> for Gwhere T: CoordFloat + GeoFloat + GeoNum, G: CoordsIter<'a, Scalar = T>,
type Scalar = T
fn minimum_rotated_rect( &'a self ) -> Option<Polygon<<G as MinimumRotatedRect<'a, T>>::Scalar>>
source§impl<G, IP, IR, T> Rotate<T> for Gwhere
T: CoordFloat,
IP: Into<Option<Point<T>>>,
IR: Into<Option<Rect<T>>>,
G: Clone + Centroid<Output = IP> + BoundingRect<T, Output = IR> + AffineOps<T>,
impl<G, IP, IR, T> Rotate<T> for Gwhere T: CoordFloat, IP: Into<Option<Point<T>>>, IR: Into<Option<Rect<T>>>, G: Clone + Centroid<Output = IP> + BoundingRect<T, Output = IR> + AffineOps<T>,
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
.