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
Source§fn clone(&self) -> CartesianPolygonCentroid
fn clone(&self) -> CartesianPolygonCentroid
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CartesianPolygonCentroid
Source§impl Debug for CartesianPolygonCentroid
impl Debug for CartesianPolygonCentroid
Source§impl Default for CartesianPolygonCentroid
impl Default for CartesianPolygonCentroid
Source§fn default() -> CartesianPolygonCentroid
fn default() -> CartesianPolygonCentroid
Returns the “default value” for a type. Read more
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