Class Polygon
java.lang.Object
org.openpatch.scratch.Shape
org.openpatch.scratch.Polygon
A polygon given by its corners, concave ones included. The outline closes by itself.
-
Constructor Summary
ConstructorsConstructorDescriptionPolygon()A polygon without corners yet; add them withaddPoint(double, double).Polygon(double[] xPoints, double[] yPoints) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPoint(double x, double y) Adds a corner after the last one.
-
Constructor Details
-
Polygon
public Polygon()A polygon without corners yet; add them withaddPoint(double, double). -
Polygon
public Polygon(double[] xPoints, double[] yPoints) - Parameters:
xPoints- x of every corneryPoints- y of every corner, in the same order
-
-
Method Details
-
addPoint
public void addPoint(double x, double y) Adds a corner after the last one.- Parameters:
x- x of the cornery- y of the corner
-