Class ConvexHull

java.lang.Object
org.jhotdraw8.geom.ConvexHull

public class ConvexHull extends Object
Provides utility methods for computing the convex hull from a set of points.
Author:
Werner Randelshofer
  • Method Details

    • getConvexHull2D

      public static List<Point2D.Double> getConvexHull2D(List<Point2D.Double> points)
      Computes the convex hull from a set of points.
      Parameters:
      points - the points
      Returns:
      convex hull of the points
    • getConvexHull2D

      public static Point2D.Double[] getConvexHull2D(Point2D.Double[] points)
      Computes the convex hull from a set of points.
      Parameters:
      points - the points
      Returns:
      convex hull of the points
    • isRightTurn2D

      public static boolean isRightTurn2D(Point2D.Double p1, Point2D.Double p2, Point2D.Double p3)
      Returns true, if the three given points make a right turn.
      Parameters:
      p1 - first point
      p2 - second point
      p3 - third point
      Returns:
      true if right turn.