pub struct Line<T> where
T: CoordNum, {
pub start: Coordinate<T>,
pub end: Coordinate<T>,
}
Expand description
A line segment made up of exactly two
Coordinate
s.
Semantics
The interior and boundary are defined as with a
LineString
with the two end points.
Fields
start: Coordinate<T>
end: Coordinate<T>
Implementations
sourceimpl<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<Coordinate<T>>,
pub fn new<C>(start: C, end: C) -> Line<T> where
C: Into<Coordinate<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 delta(&self) -> Coordinate<T>
pub fn delta(&self) -> Coordinate<T>
Calculate the difference in coordinates (Δx, Δy).
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
sourceimpl<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,
sourcefn 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);
type Epsilon = T
type Epsilon = T
Used for specifying relative comparisons.
sourcefn default_epsilon() -> <Line<T> as AbsDiffEq<Line<T>>>::Epsilon
fn default_epsilon() -> <Line<T> as AbsDiffEq<Line<T>>>::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of [AbsDiffEq::abs_diff_eq
].
sourceimpl<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
sourceimpl<T> BoundingRect<T> for Line<T> where
T: CoordNum,
impl<T> BoundingRect<T> for Line<T> where
T: CoordNum,
sourceimpl<F: GeoFloat> ClosestPoint<F, Point<F>> for Line<F>
impl<F: GeoFloat> ClosestPoint<F, Point<F>> for Line<F>
sourcefn closest_point(&self, p: &Point<F>) -> Closest<F>
fn closest_point(&self, p: &Point<F>) -> Closest<F>
Find the closest point between self
and p
.
sourceimpl<T> Contains<Coordinate<T>> for Line<T> where
T: GeoNum,
impl<T> Contains<Coordinate<T>> for Line<T> where
T: GeoNum,
fn contains(&self, coord: &Coordinate<T>) -> bool
sourceimpl<F> Contains<Line<F>> for MultiPolygon<F> where
F: GeoFloat,
impl<F> Contains<Line<F>> for MultiPolygon<F> where
F: GeoFloat,
sourceimpl<T> Contains<Line<T>> for LineString<T> where
T: GeoNum,
impl<T> Contains<Line<T>> for LineString<T> where
T: GeoNum,
sourceimpl<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
sourceimpl<T> CoordinatePosition for Line<T> where
T: GeoNum,
impl<T> CoordinatePosition for Line<T> where
T: GeoNum,
type Scalar = T
fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
fn coordinate_position(&self, coord: &Coordinate<Self::Scalar>) -> CoordPos
sourceimpl<'a, T: CoordNum> CoordsIter<'a> for Line<T>
impl<'a, T: CoordNum> CoordsIter<'a> for Line<T>
sourcefn coords_count(&'a self) -> usize
fn coords_count(&'a self) -> usize
Return the number of coordinates in the Line
.
type Iter = Chain<Once<Coordinate<T>>, Once<Coordinate<T>>>
type ExteriorIter = <Line<T> as CoordsIter<'a>>::Iter
type Scalar = T
sourcefn coords_iter(&'a self) -> Self::Iter
fn coords_iter(&'a self) -> Self::Iter
Iterate over all exterior and (if any) interior coordinates of a geometry. Read more
sourcefn exterior_coords_iter(&'a self) -> Self::ExteriorIter
fn exterior_coords_iter(&'a self) -> Self::ExteriorIter
Iterate over all exterior coordinates of a geometry. Read more
sourceimpl<T> EuclideanDistance<T, Coordinate<T>> for Line<T> where
T: GeoFloat,
impl<T> EuclideanDistance<T, Coordinate<T>> for Line<T> where
T: GeoFloat,
sourcefn euclidean_distance(&self, coord: &Coordinate<T>) -> T
fn euclidean_distance(&self, coord: &Coordinate<T>) -> T
Minimum distance from a Line
to a Coordinate
sourceimpl<T> EuclideanDistance<T, Line<T>> for Coordinate<T> where
T: GeoFloat,
impl<T> EuclideanDistance<T, Line<T>> for Coordinate<T> where
T: GeoFloat,
sourcefn euclidean_distance(&self, line: &Line<T>) -> T
fn euclidean_distance(&self, line: &Line<T>) -> T
Minimum distance from a Coordinate
to a Line
sourceimpl<T> EuclideanDistance<T, Line<T>> for Point<T> where
T: GeoFloat,
impl<T> EuclideanDistance<T, Line<T>> for Point<T> where
T: GeoFloat,
sourcefn euclidean_distance(&self, line: &Line<T>) -> T
fn euclidean_distance(&self, line: &Line<T>) -> T
Minimum distance from a Line to a Point
sourceimpl<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
sourcefn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Returns the distance between two geometries Read more
sourceimpl<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
sourcefn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Returns the distance between two geometries Read more
sourceimpl<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,
sourcefn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Returns the distance between two geometries Read more
sourceimpl<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
sourcefn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Returns the distance between two geometries Read more
sourceimpl<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
sourcefn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
Returns the distance between two geometries Read more
sourceimpl<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
sourcefn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, mpolygon: &MultiPolygon<T>) -> T
Returns the distance between two geometries Read more
sourceimpl<T> EuclideanDistance<T, Point<T>> for Line<T> where
T: GeoFloat,
impl<T> EuclideanDistance<T, Point<T>> for Line<T> where
T: GeoFloat,
sourcefn euclidean_distance(&self, point: &Point<T>) -> T
fn euclidean_distance(&self, point: &Point<T>) -> T
Minimum distance from a Line to a Point
sourceimpl<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,
sourcefn euclidean_distance(&self, other: &Polygon<T>) -> T
fn euclidean_distance(&self, other: &Polygon<T>) -> T
Returns the distance between two geometries Read more
sourceimpl<T> EuclideanLength<T, Line<T>> for Line<T> where
T: CoordFloat,
impl<T> EuclideanLength<T, Line<T>> for Line<T> where
T: CoordFloat,
sourcefn euclidean_length(&self) -> T
fn euclidean_length(&self) -> T
Calculation of the length of a Line Read more
sourceimpl<T> From<Line<T>> for LineString<T> where
T: CoordNum,
impl<T> From<Line<T>> for LineString<T> where
T: CoordNum,
sourcefn from(line: Line<T>) -> LineString<T>
fn from(line: Line<T>) -> LineString<T>
Converts to this type from the input type.
sourceimpl GeodesicLength<f64, Line<f64>> for Line<f64>
impl GeodesicLength<f64, Line<f64>> for Line<f64>
sourcefn geodesic_length(&self) -> f64
fn geodesic_length(&self) -> f64
The units of the returned value is meters.
sourceimpl<C: CoordNum> HasDimensions for Line<C>
impl<C: CoordNum> HasDimensions for Line<C>
sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Some geometries, like a MultiPoint
, can have zero coordinates - we call these empty
. Read more
sourcefn dimensions(&self) -> Dimensions
fn dimensions(&self) -> Dimensions
The dimensions of some geometries are fixed, e.g. a Point always has 0 dimensions. However
for others, the dimensionality depends on the specific geometry instance - for example
typical Rect
s are 2-dimensional, but it’s possible to create degenerate Rect
s which
have either 1 or 0 dimensions. Read more
sourcefn boundary_dimensions(&self) -> Dimensions
fn boundary_dimensions(&self) -> Dimensions
The dimensions of the Geometry
’s boundary, as used by OGC-SFA. Read more
sourceimpl<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,
sourcefn haversine_length(&self) -> T
fn haversine_length(&self) -> T
Determine the length of a geometry using the haversine formula. Read more
sourceimpl<T> Intersects<Coordinate<T>> for Line<T> where
T: GeoNum,
impl<T> Intersects<Coordinate<T>> for Line<T> where
T: GeoNum,
fn intersects(&self, rhs: &Coordinate<T>) -> bool
sourceimpl<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
sourceimpl<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
sourceimpl<T> Intersects<Line<T>> for Coordinate<T> where
Line<T>: Intersects<Coordinate<T>>,
T: CoordNum,
impl<T> Intersects<Line<T>> for Coordinate<T> where
Line<T>: Intersects<Coordinate<T>>,
T: CoordNum,
fn intersects(&self, rhs: &Line<T>) -> bool
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<T> LineInterpolatePoint<T> for Line<T> where
T: CoordFloat,
impl<T> LineInterpolatePoint<T> for Line<T> where
T: CoordFloat,
sourceimpl<T> LineLocatePoint<T, Point<T>> for Line<T> where
T: CoordFloat,
impl<T> LineLocatePoint<T, Point<T>> for Line<T> where
T: CoordFloat,
sourceimpl<T: CoordNum> MapCoordsInplace<T> for Line<T>
impl<T: CoordNum> MapCoordsInplace<T> for Line<T>
sourceimpl<T> PointDistance for Line<T> where
T: Float + RTreeNum,
impl<T> PointDistance for Line<T> where
T: Float + RTreeNum,
sourcefn distance_2(&self, point: &Point<T>) -> T
fn distance_2(&self, point: &Point<T>) -> T
Returns the squared euclidean distance of an object to a point.
sourcefn contains_point(&self, point: &<Self::Envelope as Envelope>::Point) -> bool
fn contains_point(&self, point: &<Self::Envelope as Envelope>::Point) -> bool
Returns true if a point is contained within this object. Read more
sourcefn 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>
Returns the squared distance to this object or None
if the distance
is larger than a given maximum value. Read more
sourceimpl<T> RTreeObject for Line<T> where
T: Float + RTreeNum,
impl<T> RTreeObject for Line<T> where
T: Float + RTreeNum,
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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>,
sourcefn 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);
sourcefn default_max_relative() -> <Line<T> as AbsDiffEq<Line<T>>>::Epsilon
fn default_max_relative() -> <Line<T> as AbsDiffEq<Line<T>>>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
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
The inverse of [RelativeEq::relative_eq
].
sourceimpl<T> Rotate<T> for Line<T> where
T: GeoFloat,
impl<T> Rotate<T> for Line<T> where
T: GeoFloat,
sourcefn rotate_around_centroid(&self, angle: T) -> Self
fn rotate_around_centroid(&self, angle: T) -> Self
sourcefn rotate_around_center(&self, angle: T) -> Self
fn rotate_around_center(&self, angle: T) -> Self
Rotate a geometry around the center of its bounding box by an angle, in degrees. Read more
sourceimpl<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.
sourceimpl<T: CoordNum, NT: CoordNum, E> TryMapCoords<T, NT, E> for Line<T>
impl<T: CoordNum, NT: CoordNum, E> TryMapCoords<T, NT, E> for Line<T>
sourceimpl<T: CoordNum, E> TryMapCoordsInplace<T, E> for Line<T>
impl<T: CoordNum, E> TryMapCoordsInplace<T, E> for Line<T>
sourceimpl<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,
sourcefn 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T, G> Extremes<'a, T> for G where
G: CoordsIter<'a, Scalar = T>,
T: CoordNum,
impl<'a, T, G> Extremes<'a, T> for G where
G: CoordsIter<'a, Scalar = T>,
T: CoordNum,
sourceimpl<T, G> RotatePoint<T> for G where
T: CoordFloat,
G: MapCoords<T, T, Output = G>,
impl<T, G> RotatePoint<T> for G where
T: CoordFloat,
G: MapCoords<T, T, Output = G>,
sourcefn rotate_around_point(&self, angle: T, point: Point<T>) -> G
fn rotate_around_point(&self, angle: T, point: Point<T>) -> G
Rotate a Geometry around an arbitrary point by an angle, given in degrees Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T, G> Translate<T> for G where
T: CoordNum,
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,
impl<T, G> Translate<T> for G where
T: CoordNum,
G: MapCoords<T, T, Output = G> + MapCoordsInplace<T>,
sourcefn translate(&self, xoff: T, yoff: T) -> G
fn translate(&self, xoff: T, yoff: T) -> G
Translate a Geometry along its axes by the given offsets Read more
sourcefn translate_inplace(&mut self, xoff: T, yoff: T)
fn translate_inplace(&mut self, xoff: T, yoff: T)
Translate a Geometry along its axes, but in place.