public class FloatPolygon extends Object
Modifier and Type | Field and Description |
---|---|
int |
npoints
The number of points.
|
float[] |
xpoints |
float[] |
ypoints |
Constructor and Description |
---|
FloatPolygon()
Constructs an empty FloatPolygon.
|
FloatPolygon(float[] xpoints,
float[] ypoints)
Constructs a FloatPolygon from x and y arrays.
|
FloatPolygon(float[] xpoints,
float[] ypoints,
int npoints)
Constructs a FloatPolygon from x and y arrays.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(double x,
double y) |
void |
addPoint(float x,
float y) |
boolean |
contains(double x,
double y)
Returns 'true' if the point (x,y) is inside this polygon.
|
FloatPolygon |
duplicate() |
Rectangle |
getBounds() |
FloatPolygon |
getConvexHull()
Uses the gift wrap algorithm to find the convex hull of all points in
this FloatPolygon and returns it as a new FloatPolygon.
|
Rectangle2D.Double |
getFloatBounds() |
double |
getLength(boolean isLine) |
String |
toString() |
public int npoints
public float[] xpoints
public float[] ypoints
public FloatPolygon()
public FloatPolygon(float[] xpoints, float[] ypoints)
public FloatPolygon(float[] xpoints, float[] ypoints, int npoints)
public boolean contains(double x, double y)
public Rectangle getBounds()
public Rectangle2D.Double getFloatBounds()
public void addPoint(float x, float y)
public void addPoint(double x, double y)
public FloatPolygon duplicate()
public double getLength(boolean isLine)
public FloatPolygon getConvexHull()
Copyright © 1997–2019 NIH. All rights reserved.