us.ihmc.utilities.math.geometry
Class GrahamScanConvexHullCalculator2d
java.lang.Object
us.ihmc.utilities.math.geometry.GrahamScanConvexHullCalculator2d
public class GrahamScanConvexHullCalculator2d
- extends java.lang.Object
Adapted from http://algs4.cs.princeton.edu/99hull/GrahamScan.java.html
TODO: make it return the points in clockwise order instead of counterclockwise
TODO: reduce garbage generation
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GrahamScanConvexHullCalculator2d
public GrahamScanConvexHullCalculator2d(java.util.List<javax.vecmath.Point2d> pointList)
createFromPointList
public static GrahamScanConvexHullCalculator2d createFromPointList(double[][] pointList)
hull
public java.lang.Iterable<javax.vecmath.Point2d> hull()
equals
public static boolean equals(javax.vecmath.Point2d p1,
javax.vecmath.Point2d p2)
ccw
public static int ccw(javax.vecmath.Point2d a,
javax.vecmath.Point2d b,
javax.vecmath.Point2d c)
main
public static void main(java.lang.String[] args)
getClockwiseOrderedListOfPoints
public java.util.List<javax.vecmath.Point2d> getClockwiseOrderedListOfPoints()