pub struct Triangle<T = f64>(pub Coord<T>, pub Coord<T>, pub Coord<T>)
where
T: CoordNum;
Expand description
A bounded 2D area whose three vertices are defined by
Coord
s. The semantics and validity are that of
the equivalent Polygon
; in addition, the three
vertices must not be collinear and they must be distinct.
Tuple Fields§
§0: Coord<T>
§1: Coord<T>
§2: Coord<T>
Implementations§
source§impl<T> Triangle<T>where
T: CoordNum,
impl<T> Triangle<T>where
T: CoordNum,
sourcepub fn new(v1: Coord<T>, v2: Coord<T>, v3: Coord<T>) -> Triangle<T>
pub fn new(v1: Coord<T>, v2: Coord<T>, v3: Coord<T>) -> Triangle<T>
Instantiate Self from the raw content value
pub fn to_array(&self) -> [Coord<T>; 3]
pub fn to_lines(&self) -> [Line<T>; 3]
sourcepub fn to_polygon(self) -> Polygon<T>
pub fn to_polygon(self) -> Polygon<T>
Create a Polygon
from the Triangle
.
§Examples
use geo_types::{coord, Triangle, polygon};
let triangle = Triangle::new(
coord! { x: 0., y: 0. },
coord! { x: 10., y: 20. },
coord! { x: 20., y: -10. },
);
assert_eq!(
triangle.to_polygon(),
polygon![
(x: 0., y: 0.),
(x: 10., y: 20.),
(x: 20., y: -10.),
(x: 0., y: 0.),
],
);
Trait Implementations§
source§impl<T> AbsDiffEq for Triangle<T>
impl<T> AbsDiffEq for Triangle<T>
source§fn abs_diff_eq(
&self,
other: &Triangle<T>,
epsilon: <Triangle<T> as AbsDiffEq>::Epsilon
) -> bool
fn abs_diff_eq( &self, other: &Triangle<T>, epsilon: <Triangle<T> as AbsDiffEq>::Epsilon ) -> bool
Equality assertion with an absolute limit.
§Examples
use geo_types::{point, Triangle};
let a = Triangle::new((0.0, 0.0).into(), (10.0, 10.0).into(), (0.0, 5.0).into());
let b = Triangle::new((0.0, 0.0).into(), (10.01, 10.0).into(), (0.0, 5.0).into());
approx::abs_diff_eq!(a, b, epsilon=0.1);
approx::abs_diff_ne!(a, b, epsilon=0.001);
source§fn default_epsilon() -> <Triangle<T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Triangle<T> as AbsDiffEq>::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
].source§impl<T> Area<T> for Triangle<T>where
T: CoordFloat,
impl<T> Area<T> for Triangle<T>where
T: CoordFloat,
fn signed_area(&self) -> T
fn unsigned_area(&self) -> T
source§impl<T> BoundingRect<T> for Triangle<T>where
T: CoordNum,
impl<T> BoundingRect<T> for Triangle<T>where
T: CoordNum,
source§impl<T> Centroid for Triangle<T>where
T: GeoFloat,
impl<T> Centroid for Triangle<T>where
T: GeoFloat,
source§impl<T> ChamberlainDuquetteArea<T> for Triangle<T>where
T: CoordFloat,
impl<T> ChamberlainDuquetteArea<T> for Triangle<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 Triangle<F>
impl<F: GeoFloat> ClosestPoint<F> for Triangle<F>
source§fn 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
.source§impl<T> Contains<GeometryCollection<T>> for Triangle<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for Triangle<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
source§impl<T> Contains<LineString<T>> for Triangle<T>where
T: GeoFloat,
impl<T> Contains<LineString<T>> for Triangle<T>where
T: GeoFloat,
fn contains(&self, target: &LineString<T>) -> bool
source§impl<T> Contains<MultiLineString<T>> for Triangle<T>where
T: GeoFloat,
impl<T> Contains<MultiLineString<T>> for Triangle<T>where
T: GeoFloat,
fn contains(&self, target: &MultiLineString<T>) -> bool
source§impl<T> Contains<MultiPoint<T>> for Triangle<T>where
T: GeoFloat,
impl<T> Contains<MultiPoint<T>> for Triangle<T>where
T: GeoFloat,
fn contains(&self, target: &MultiPoint<T>) -> bool
source§impl<T> Contains<MultiPolygon<T>> for Triangle<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for Triangle<T>where
T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
source§impl<T> CoordinatePosition for Triangle<T>where
T: GeoNum,
impl<T> CoordinatePosition for Triangle<T>where
T: GeoNum,
source§impl<T: CoordNum> CoordsIter for Triangle<T>
impl<T: CoordNum> CoordsIter for Triangle<T>
source§fn coords_count(&self) -> usize
fn coords_count(&self) -> usize
Return the number of coordinates in the Triangle
.
type Iter<'a> = Chain<Chain<Once<Coord<T>>, Once<Coord<T>>>, Once<Coord<T>>> where T: 'a
type ExteriorIter<'a> = <Triangle<T> as CoordsIter>::Iter<'a> where T: 'a
type Scalar = T
source§fn coords_iter(&self) -> Self::Iter<'_>
fn coords_iter(&self) -> Self::Iter<'_>
Iterate over all exterior and (if any) interior coordinates of a geometry. Read more
source§fn exterior_coords_iter(&self) -> Self::ExteriorIter<'_>
fn exterior_coords_iter(&self) -> Self::ExteriorIter<'_>
Iterate over all exterior coordinates of a geometry. Read more
source§impl<T> DensifyHaversine<T> for Triangle<T>where
T: CoordFloat + FromPrimitive,
Line<T>: HaversineLength<T>,
LineString<T>: HaversineLength<T>,
impl<T> DensifyHaversine<T> for Triangle<T>where
T: CoordFloat + FromPrimitive,
Line<T>: HaversineLength<T>,
LineString<T>: HaversineLength<T>,
source§impl<T> EuclideanDistance<T> for Triangle<T>
impl<T> EuclideanDistance<T> for Triangle<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Geometry<T>> for Triangle<T>
impl<T> EuclideanDistance<T, Geometry<T>> for Triangle<T>
source§fn euclidean_distance(&self, geom: &Geometry<T>) -> T
fn euclidean_distance(&self, geom: &Geometry<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, GeometryCollection<T>> for Triangle<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for Triangle<T>
source§fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, other: &GeometryCollection<T>) -> T
Returns the distance between two geometries Read more
source§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
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, LineString<T>> for Triangle<T>
impl<T> EuclideanDistance<T, LineString<T>> for Triangle<T>
source§fn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, MultiLineString<T>> for Triangle<T>
impl<T> EuclideanDistance<T, MultiLineString<T>> for Triangle<T>
source§fn euclidean_distance(&self, other: &MultiLineString<T>) -> T
fn euclidean_distance(&self, other: &MultiLineString<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, MultiPoint<T>> for Triangle<T>
impl<T> EuclideanDistance<T, MultiPoint<T>> for Triangle<T>
source§fn euclidean_distance(&self, other: &MultiPoint<T>) -> T
fn euclidean_distance(&self, other: &MultiPoint<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, MultiPolygon<T>> for Triangle<T>
impl<T> EuclideanDistance<T, MultiPolygon<T>> for Triangle<T>
source§fn euclidean_distance(&self, other: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, other: &MultiPolygon<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Point<T>> for Triangle<T>
impl<T> EuclideanDistance<T, Point<T>> for Triangle<T>
source§fn euclidean_distance(&self, other: &Point<T>) -> T
fn euclidean_distance(&self, other: &Point<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Polygon<T>> for Triangle<T>
impl<T> EuclideanDistance<T, Polygon<T>> for Triangle<T>
source§fn euclidean_distance(&self, other: &Polygon<T>) -> T
fn euclidean_distance(&self, other: &Polygon<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Rect<T>> for Triangle<T>
impl<T> EuclideanDistance<T, Rect<T>> for Triangle<T>
source§fn euclidean_distance(&self, other: &Rect<T>) -> T
fn euclidean_distance(&self, other: &Rect<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Triangle<T>> for Geometry<T>
impl<T> EuclideanDistance<T, Triangle<T>> for Geometry<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Triangle<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, Triangle<T>> for GeometryCollection<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§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
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Triangle<T>> for LineString<T>
impl<T> EuclideanDistance<T, Triangle<T>> for LineString<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Triangle<T>> for MultiLineString<T>
impl<T> EuclideanDistance<T, Triangle<T>> for MultiLineString<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Triangle<T>> for MultiPoint<T>
impl<T> EuclideanDistance<T, Triangle<T>> for MultiPoint<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Triangle<T>> for MultiPolygon<T>
impl<T> EuclideanDistance<T, Triangle<T>> for MultiPolygon<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Triangle<T>> for Point<T>
impl<T> EuclideanDistance<T, Triangle<T>> for Point<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Triangle<T>> for Polygon<T>
impl<T> EuclideanDistance<T, Triangle<T>> for Polygon<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§impl<T> EuclideanDistance<T, Triangle<T>> for Rect<T>
impl<T> EuclideanDistance<T, Triangle<T>> for Rect<T>
source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Returns the distance between two geometries Read more
source§impl GeodesicArea<f64> for Triangle
impl GeodesicArea<f64> for Triangle
source§fn geodesic_perimeter(&self) -> f64
fn geodesic_perimeter(&self) -> f64
Determine the perimeter of a geometry on an ellipsoidal model of the earth. Read more
source§fn geodesic_area_signed(&self) -> f64
fn geodesic_area_signed(&self) -> f64
Determine the area of a geometry on an ellipsoidal model of the earth. Read more
source§fn geodesic_area_unsigned(&self) -> f64
fn geodesic_area_unsigned(&self) -> f64
Determine the area of a geometry on an ellipsoidal model of the earth. Supports very large geometries that cover a significant portion of the earth. Read more
source§impl<C: GeoNum> HasDimensions for Triangle<C>
impl<C: GeoNum> HasDimensions for Triangle<C>
source§fn 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 moresource§fn boundary_dimensions(&self) -> Dimensions
fn boundary_dimensions(&self) -> Dimensions
The dimensions of the
Geometry
’s boundary, as used by OGC-SFA. Read moresource§impl<T> HaversineClosestPoint<T> for Triangle<T>where
T: GeoFloat + FromPrimitive,
impl<T> HaversineClosestPoint<T> for Triangle<T>where
T: GeoFloat + FromPrimitive,
fn haversine_closest_point(&self, from: &Point<T>) -> Closest<T>
source§impl<T> InteriorPoint for Triangle<T>where
T: GeoFloat,
impl<T> InteriorPoint for Triangle<T>where
T: GeoFloat,
source§impl<T> Intersects<Coord<T>> for Triangle<T>where
T: GeoNum,
impl<T> Intersects<Coord<T>> for Triangle<T>where
T: GeoNum,
fn intersects(&self, rhs: &Coord<T>) -> bool
source§impl<T> Intersects<Geometry<T>> for Triangle<T>
impl<T> Intersects<Geometry<T>> for Triangle<T>
fn intersects(&self, rhs: &Geometry<T>) -> bool
source§impl<T> Intersects<GeometryCollection<T>> for Triangle<T>
impl<T> Intersects<GeometryCollection<T>> for Triangle<T>
fn intersects(&self, rhs: &GeometryCollection<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 Triangle<T>
impl<T> Intersects<LineString<T>> for Triangle<T>
fn intersects(&self, rhs: &LineString<T>) -> bool
source§impl<T> Intersects<MultiLineString<T>> for Triangle<T>
impl<T> Intersects<MultiLineString<T>> for Triangle<T>
fn intersects(&self, rhs: &MultiLineString<T>) -> bool
source§impl<T> Intersects<MultiPoint<T>> for Triangle<T>
impl<T> Intersects<MultiPoint<T>> for Triangle<T>
fn intersects(&self, rhs: &MultiPoint<T>) -> bool
source§impl<T> Intersects<MultiPolygon<T>> for Triangle<T>
impl<T> Intersects<MultiPolygon<T>> for Triangle<T>
fn intersects(&self, rhs: &MultiPolygon<T>) -> bool
source§impl<T> Intersects<Point<T>> for Triangle<T>
impl<T> Intersects<Point<T>> for Triangle<T>
fn intersects(&self, rhs: &Point<T>) -> bool
source§impl<T> Intersects<Polygon<T>> for Triangle<T>
impl<T> Intersects<Polygon<T>> for Triangle<T>
fn intersects(&self, rhs: &Polygon<T>) -> bool
source§impl<T> Intersects<Rect<T>> for Triangle<T>
impl<T> Intersects<Rect<T>> for Triangle<T>
fn intersects(&self, rhs: &Rect<T>) -> bool
source§impl<T> Intersects<Triangle<T>> for Coord<T>
impl<T> Intersects<Triangle<T>> for Coord<T>
fn intersects(&self, rhs: &Triangle<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<Triangle<T>> for Polygon<T>where
T: GeoNum,
impl<T> Intersects<Triangle<T>> for Polygon<T>where
T: GeoNum,
fn intersects(&self, rect: &Triangle<T>) -> bool
source§impl<T> Intersects<Triangle<T>> for Rect<T>where
T: GeoNum,
impl<T> Intersects<Triangle<T>> for Rect<T>where
T: GeoNum,
fn intersects(&self, rhs: &Triangle<T>) -> bool
source§impl<T> Intersects for Triangle<T>where
T: GeoNum,
impl<T> Intersects for Triangle<T>where
T: GeoNum,
fn intersects(&self, rhs: &Triangle<T>) -> bool
source§impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for Triangle<T>
impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for Triangle<T>
source§impl<T: CoordNum> MapCoordsInPlace<T> for Triangle<T>
impl<T: CoordNum> MapCoordsInPlace<T> for Triangle<T>
source§impl<T> PartialEq for Triangle<T>
impl<T> PartialEq for Triangle<T>
source§impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, GeometryCollection<F>> for Triangle<F>
fn relate(&self, other: &GeometryCollection<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 Triangle<F>
impl<F: GeoFloat> Relate<F, LineString<F>> for Triangle<F>
fn relate(&self, other: &LineString<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, MultiLineString<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, MultiLineString<F>> for Triangle<F>
fn relate(&self, other: &MultiLineString<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, MultiPoint<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, MultiPoint<F>> for Triangle<F>
fn relate(&self, other: &MultiPoint<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, MultiPolygon<F>> for Triangle<F>
fn relate(&self, other: &MultiPolygon<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Point<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, Point<F>> for Triangle<F>
fn relate(&self, other: &Point<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Polygon<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, Polygon<F>> for Triangle<F>
fn relate(&self, other: &Polygon<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Rect<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, Rect<F>> for Triangle<F>
fn relate(&self, other: &Rect<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Triangle<F>> for GeometryCollection<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for GeometryCollection<F>
fn relate(&self, other: &Triangle<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<F: GeoFloat> Relate<F, Triangle<F>> for LineString<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for LineString<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Triangle<F>> for MultiLineString<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for MultiLineString<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Triangle<F>> for MultiPoint<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for MultiPoint<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Triangle<F>> for MultiPolygon<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for MultiPolygon<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Triangle<F>> for Point<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for Point<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Triangle<F>> for Polygon<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for Polygon<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Triangle<F>> for Rect<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for Rect<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
source§impl<F: GeoFloat> Relate<F, Triangle<F>> for Triangle<F>
impl<F: GeoFloat> Relate<F, Triangle<F>> for Triangle<F>
fn relate(&self, other: &Triangle<F>) -> IntersectionMatrix
source§impl<T> RelativeEq for Triangle<T>where
T: AbsDiffEq<Epsilon = T> + CoordNum + RelativeEq,
impl<T> RelativeEq for Triangle<T>where
T: AbsDiffEq<Epsilon = T> + CoordNum + RelativeEq,
source§fn relative_eq(
&self,
other: &Triangle<T>,
epsilon: <Triangle<T> as AbsDiffEq>::Epsilon,
max_relative: <Triangle<T> as AbsDiffEq>::Epsilon
) -> bool
fn relative_eq( &self, other: &Triangle<T>, epsilon: <Triangle<T> as AbsDiffEq>::Epsilon, max_relative: <Triangle<T> as AbsDiffEq>::Epsilon ) -> bool
Equality assertion within a relative limit.
§Examples
use geo_types::{point, Triangle};
let a = Triangle::new((0.0, 0.0).into(), (10.0, 10.0).into(), (0.0, 5.0).into());
let b = Triangle::new((0.0, 0.0).into(), (10.01, 10.0).into(), (0.0, 5.0).into());
approx::assert_relative_eq!(a, b, max_relative=0.1);
approx::assert_relative_ne!(a, b, max_relative=0.0001);
source§fn default_max_relative() -> <Triangle<T> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <Triangle<T> as AbsDiffEq>::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
].source§impl<T> RemoveRepeatedPoints<T> for Triangle<T>where
T: CoordNum + FromPrimitive,
impl<T> RemoveRepeatedPoints<T> for Triangle<T>where
T: CoordNum + FromPrimitive,
source§fn remove_repeated_points(&self) -> Self
fn remove_repeated_points(&self) -> Self
Create a new geometry with (consecutive) repeated points removed.
source§fn remove_repeated_points_mut(&mut self)
fn remove_repeated_points_mut(&mut self)
Remove (consecutive) repeated points inplace.
source§impl<T> TryFrom<Geometry<T>> for Triangle<T>where
T: CoordNum,
impl<T> TryFrom<Geometry<T>> for Triangle<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.
impl<T> Copy for Triangle<T>
impl<T> Eq for Triangle<T>
impl<T> StructuralPartialEq for Triangle<T>where
T: CoordNum,
Auto Trait Implementations§
impl<T> RefUnwindSafe for Triangle<T>where
T: RefUnwindSafe,
impl<T> Send for Triangle<T>where
T: Send,
impl<T> Sync for Triangle<T>where
T: Sync,
impl<T> Unpin for Triangle<T>where
T: Unpin,
impl<T> UnwindSafe for Triangle<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
Apply
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>)
Apply
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
Mutably borrows from an owned value. Read more
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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, 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<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)
Mutable version of
Self::rotate_around_centroid
source§fn rotate_around_center(&self, degrees: T) -> G
fn rotate_around_center(&self, degrees: T) -> G
Rotate a geometry around the center of its bounding box by an angle, in
degrees. Read more
source§fn rotate_around_center_mut(&mut self, degrees: T)
fn rotate_around_center_mut(&mut self, degrees: T)
Mutable version of
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
Rotate a Geometry around an arbitrary point by an angle, given in degrees Read more
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>)
Mutable version of
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
Scale a geometry from it’s bounding box center. Read more
source§fn scale_xy(&self, x_factor: T, y_factor: T) -> G
fn scale_xy(&self, x_factor: T, y_factor: T) -> G
Scale a geometry from it’s bounding box center, using different values for
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)
Mutable version of
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
Scale a geometry around a point of
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>> )
Mutable version of
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
An affine transformation which skews a geometry, sheared by a uniform angle along the x and
y dimensions. Read more
source§fn skew_xy(&self, degrees_x: T, degrees_y: T) -> G
fn skew_xy(&self, degrees_x: T, degrees_y: T) -> G
An affine transformation which skews a geometry, sheared by an angle along the x and y dimensions. Read more
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)
Mutable version of
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
An affine transformation which skews a geometry around a point of
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>>)
Mutable version of
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> 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>>
returns a triangulation that’s solely based on the points of the geometric object Read more
source§fn constrained_outer_triangulation(
&'a self,
config: SpadeTriangulationConfig<T>
) -> TriangulationResult<Triangles<T>>
fn constrained_outer_triangulation( &'a self, config: SpadeTriangulationConfig<T> ) -> TriangulationResult<Triangles<T>>
returns triangulation that’s based on the points of the geometric object and also
incorporates the lines of the input geometry Read more
source§fn constrained_triangulation(
&'a self,
config: SpadeTriangulationConfig<T>
) -> TriangulationResult<Triangles<T>>
fn constrained_triangulation( &'a self, config: SpadeTriangulationConfig<T> ) -> TriangulationResult<Triangles<T>>
returns triangulation that’s based on the points of the geometric object and also
incorporates the lines of the input geometry Read more