@AnyLogicInternalAPI public class Polygon2D extends java.lang.Object implements java.io.Serializable
Constructor and Description |
---|
Polygon2D(MarkupShape owner) |
Modifier and Type | Method and Description |
---|---|
void |
addVertex(double x,
double y) |
boolean |
contains(double px,
double py) |
double |
getArea() |
Point |
getCenter(Point out) |
double |
getNearestPoint(Point output,
double rx,
double ry) |
int |
getNPoints()
Returns the number of points in the markup element.
|
java.awt.geom.Path2D.Double |
getPath() |
double |
getPointDx(int i)
Returns the x coordinate of a particular point of the markup element relative to the start point.
|
double |
getPointDy(int i)
Returns the y coordinate of a particular point of the markup element relative to the start point.
|
double |
getXMax()
Returns the x coordinate of the bottom-right corner of bounding rectangle for this markup element.
|
double |
getXMin()
Returns the x coordinate of the top-left corner of bounding rectangle for this markup element.
|
double |
getYMax()
Returns the y coordinate of the bottom-right corner of bounding rectangle for this markup element.
|
double |
getYMin()
Returns the y coordinate of the top-left corner of bounding rectangle for this markup element.
|
void |
initialize() |
Point |
randomPointInside(java.util.Random rng,
Point out) |
void |
setPoints(double[] dx,
double[] dy) |
public Polygon2D(MarkupShape owner)
public void setPoints(double[] dx, double[] dy)
public void addVertex(double x, double y)
public void initialize()
public double getXMin()
#getX()
is included)public double getXMax()
#getX()
is included)public double getYMin()
#getY()
is included)public double getYMax()
#getY()
is included)public int getNPoints()
public double getPointDx(int i)
i
- the index of the point (starting from 0)#getX()
, #getY()
)public double getPointDy(int i)
i
- the index of the point (starting from 0)#getX()
, #getY()
)public double getArea()
public java.awt.geom.Path2D.Double getPath()
public boolean contains(double px, double py)
public double getNearestPoint(Point output, double rx, double ry)
Copyright © AnyLogic North America, LLC. All Rights Reserved.