Package com.google.common.geometry
Class S2AreaCentroid
- java.lang.Object
-
- com.google.common.geometry.S2AreaCentroid
-
- All Implemented Interfaces:
java.io.Serializable
@GwtCompatible(serializable=true) public final class S2AreaCentroid extends java.lang.Object implements java.io.Serializable
The area of an interior, i.e. the region on the left side of an odd number of loops and optionally a centroid. The area is between 0 and 4*Pi. If it has a centroid, it is the true centroid of the interior multiplied by the area of the shape. Note that the centroid may not be contained by the shape.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description S2AreaCentroid(double area, S2Point centroid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
double
getArea()
S2Point
getCentroid()
int
hashCode()
-
-
-
Field Detail
-
area
private final double area
-
centroid
private final S2Point centroid
-
-
Constructor Detail
-
S2AreaCentroid
public S2AreaCentroid(double area, @Nullable S2Point centroid)
-
-
Method Detail
-
getArea
public double getArea()
-
getCentroid
@Nullable public S2Point getCentroid()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-