Class Polygon
java.lang.Object
ch.epfl.cs107.play.math.shape.Shape
ch.epfl.cs107.play.math.shape.Polygon
Represents a polygon, without self-intersection.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Polygon
-
Polygon
Creates a new polygon.- Parameters:
points- (Array of points): sequence of vertices, not null
-
Polygon
public Polygon(double... points) Creates a new polygon.- Parameters:
points- (Array of double): sequence of vertices (x1, y1, x2, y2, etc.), not null
-
-
Method Details
-
getPoints
-
getArea
-
getPerimeter
public double getPerimeter()- Specified by:
getPerimeterin classShape- Returns:
- shape perimeter
-
sample
-
toPath
-