public class Polygon
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
double |
getArea()
Returns the area of the polygon.
|
Position |
getCenter()
Returns the centroid of the polygon.
|
Position |
getNearestPoint(Position p)
Returns the point on the boundary of the polygon that is nearest to the given point.
|
double |
getPerimeter()
Returns the perimeter of the polygon.
|
boolean |
isInside(Position p)
Returns true if the given point is inside the polygon.
|
public double getArea()
public double getPerimeter()
public Position getCenter()
public boolean isInside(Position p)