org.jhotdraw.geom
Class ConvexHull
- java.lang.Object
-
- org.jhotdraw.geom.ConvexHull
-
public class ConvexHull extends java.lang.ObjectProvides utility methods for computing the convex hull from a set of points.
-
-
Constructor Summary
Constructors Constructor and Description ConvexHull()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.util.List<java.awt.Point>getConvexHull(java.util.List<java.awt.Point> points)Computes the convex hull from a set of points.static java.awt.Point[]getConvexHull(java.awt.Point[] points)Computes the convex hull from a set of points.static java.util.List<java.awt.geom.Point2D.Double>getConvexHull2D(java.util.List<java.awt.geom.Point2D.Double> points)Computes the convex hull from a set of points.static java.awt.geom.Point2D.Double[]getConvexHull2D(java.awt.geom.Point2D.Double[] points)Computes the convex hull from a set of points.static Polygon2D.DoublegetConvexHullPath2D(java.util.List<java.awt.geom.Point2D.Double> points)Computes the convex hull from a set of points.static Polygon2D.DoublegetConvexHullPath2D(java.awt.Shape shape)Computes the convex hull from a shape.static java.awt.PolygongetConvexHullPolygon(java.util.List<java.awt.Point> points)Computes the convex hull from a set of points.static booleanisRightTurn(java.awt.Point p1, java.awt.Point p2, java.awt.Point p3)Returns true, if the three given points make a right turn.static booleanisRightTurn2D(java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2, java.awt.geom.Point2D.Double p3)Returns true, if the three given points make a right turn.
-
-
-
Method Detail
-
getConvexHullPolygon
public static java.awt.Polygon getConvexHullPolygon(java.util.List<java.awt.Point> points)
Computes the convex hull from a set of points.- Parameters:
points-- Returns:
- convex hull of the points as a polygon object.
-
getConvexHullPath2D
public static Polygon2D.Double getConvexHullPath2D(java.util.List<java.awt.geom.Point2D.Double> points)
Computes the convex hull from a set of points.- Parameters:
points-- Returns:
- convex hull of the points as a Polygon2D object.
-
getConvexHullPath2D
public static Polygon2D.Double getConvexHullPath2D(java.awt.Shape shape)
Computes the convex hull from a shape.- Parameters:
shape- an arbitray shape- Returns:
- convex hull of the points as a Polygon2D object.
-
getConvexHull
public static java.util.List<java.awt.Point> getConvexHull(java.util.List<java.awt.Point> points)
Computes the convex hull from a set of points.- Parameters:
points-- Returns:
- convex hull of the points
-
getConvexHull2D
public static java.util.List<java.awt.geom.Point2D.Double> getConvexHull2D(java.util.List<java.awt.geom.Point2D.Double> points)
Computes the convex hull from a set of points.- Parameters:
points-- Returns:
- convex hull of the points
-
getConvexHull
public static java.awt.Point[] getConvexHull(java.awt.Point[] points)
Computes the convex hull from a set of points.- Parameters:
points-- Returns:
- convex hull of the points
-
isRightTurn
public static boolean isRightTurn(java.awt.Point p1, java.awt.Point p2, java.awt.Point p3)Returns true, if the three given points make a right turn.- Parameters:
p1- first pointp2- second pointp3- third point- Returns:
- true if right turn.
-
getConvexHull2D
public static java.awt.geom.Point2D.Double[] getConvexHull2D(java.awt.geom.Point2D.Double[] points)
Computes the convex hull from a set of points.- Parameters:
points-- Returns:
- convex hull of the points
-
isRightTurn2D
public static boolean isRightTurn2D(java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2, java.awt.geom.Point2D.Double p3)Returns true, if the three given points make a right turn.- Parameters:
p1- first pointp2- second pointp3- third point- Returns:
- true if right turn.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG