pub struct CartesianPolygonCentroid;Expand description
Cartesian centroid for a geometry_trait::Polygon — the CartesianRingCentroid
formula applied to every ring (exterior plus interiors), combined by
signed area.
Mirrors the polygon arm of
boost/geometry/algorithms/centroid.hpp: each interior ring’s
(oppositely-wound, hence oppositely-signed) area-weighted centroid is
folded into the running sum, so a plain area-weighted combine already
performs the hole correction.
Trait Implementations§
Source§impl<G> CentroidStrategy<G> for CartesianPolygonCentroidwhere
G: PolygonTrait,
G::Point: PointTrait + PointMut + Default + Copy,
<<G::Point as PointTrait>::Cs as CoordinateSystem>::Family: SameAs<CartesianFamily>,
ShoelaceArea: AreaStrategy<G::Ring, Out = <G::Point as PointTrait>::Scalar>,
CartesianRingCentroid: CentroidStrategy<G::Ring, Output = G::Point>,
impl<G> CentroidStrategy<G> for CartesianPolygonCentroidwhere
G: PolygonTrait,
G::Point: PointTrait + PointMut + Default + Copy,
<<G::Point as PointTrait>::Cs as CoordinateSystem>::Family: SameAs<CartesianFamily>,
ShoelaceArea: AreaStrategy<G::Ring, Out = <G::Point as PointTrait>::Scalar>,
CartesianRingCentroid: CentroidStrategy<G::Ring, Output = G::Point>,
Source§impl Clone for CartesianPolygonCentroid
impl Clone for CartesianPolygonCentroid
impl Copy for CartesianPolygonCentroid
Source§impl Debug for CartesianPolygonCentroid
impl Debug for CartesianPolygonCentroid
Auto Trait Implementations§
impl Freeze for CartesianPolygonCentroid
impl RefUnwindSafe for CartesianPolygonCentroid
impl Send for CartesianPolygonCentroid
impl Sync for CartesianPolygonCentroid
impl Unpin for CartesianPolygonCentroid
impl UnsafeUnpin for CartesianPolygonCentroid
impl UnwindSafe for CartesianPolygonCentroid
Blanket Implementations§
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