|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object math.geom2d.polygon.Polygons2D
public final class Polygons2D
Several utility functions for working on polygons, including polygon creation, and basic computations. I
Constructor Summary | |
---|---|
Polygons2D()
|
Method Summary | |
---|---|
static Polygon2D |
clipPolygon(Polygon2D polygon,
Box2D box)
Clips a polygon by a box. |
static double |
computeArea(LinearRing2D ring)
Computes the signed area of the linear ring. |
static double |
computeArea(Polygon2D polygon)
Computes the signed area of the polygon. |
static Point2D |
computeCentroid(LinearRing2D ring)
Computes the centroid of the given linear ring. |
static Point2D |
computeCentroid(Polygon2D polygon)
Computes the centroid of the given polygon. |
static CirculinearDomain2D |
createBuffer(Polygon2D polygon,
double dist)
Computes the buffer at a distance d of the input polygon. |
static SimplePolygon2D |
createCenteredRectangle(Point2D center,
double length,
double width)
Creates a new polygon representing a rectangle centered around a point. |
static SimplePolygon2D |
createOrientedRectangle(Point2D center,
double length,
double width,
double theta)
Creates a new polygon representing an oriented rectangle centered around a point. |
static SimplePolygon2D |
createRectangle(double x1,
double y1,
double x2,
double y2)
Creates a new polygon representing a rectangle with edges parallel to the main directions, and having the two specified opposite corners. |
static SimplePolygon2D |
createRectangle(Point2D p1,
Point2D p2)
Creates a new polygon representing a rectangle with edges parallel to the main directions, and having the two specified opposite corners. |
static Polygon2D |
difference(Polygon2D polygon1,
Polygon2D polygon2)
Computes the Difference of the two polygons. |
static Polygon2D |
exclusiveOr(Polygon2D polygon1,
Polygon2D polygon2)
Computes the exclusive XOR of the two polygons. |
static Polygon2D |
intersection(Polygon2D polygon1,
Polygon2D polygon2)
Computes the intersection of the two polygons. |
static Polygon2D |
union(Polygon2D polygon1,
Polygon2D polygon2)
Computes the union of the two polygons. |
static int |
windingNumber(java.util.Collection<Point2D> vertices,
Point2D point)
Computes the winding number of the polygon. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Polygons2D()
Method Detail |
---|
public static final SimplePolygon2D createRectangle(Point2D p1, Point2D p2)
public static final SimplePolygon2D createRectangle(double x1, double y1, double x2, double y2)
public static final SimplePolygon2D createCenteredRectangle(Point2D center, double length, double width)
public static final SimplePolygon2D createOrientedRectangle(Point2D center, double length, double width, double theta)
public static final Point2D computeCentroid(Polygon2D polygon)
public static final Point2D computeCentroid(LinearRing2D ring)
public static final double computeArea(Polygon2D polygon)
public static final double computeArea(LinearRing2D ring)
public static final int windingNumber(java.util.Collection<Point2D> vertices, Point2D point)
vertices
- the vertices of a polygonpoint
- the reference point
public static final CirculinearDomain2D createBuffer(Polygon2D polygon, double dist)
CirculinearShape2D.buffer(double)
public static final Polygon2D clipPolygon(Polygon2D polygon, Box2D box)
Polygon2D.clip(Box2D)
public static final Polygon2D union(Polygon2D polygon1, Polygon2D polygon2)
public static final Polygon2D intersection(Polygon2D polygon1, Polygon2D polygon2)
public static final Polygon2D exclusiveOr(Polygon2D polygon1, Polygon2D polygon2)
public static final Polygon2D difference(Polygon2D polygon1, Polygon2D polygon2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |