runelite-api/src/main/java/net/runelite/api/model/Jarvis.java
/**
	 * compute the convex hull of a given set of points
	 *
	 * @param points
	 * @return
	 */
compute the convex hull of a given set of points
@param points
@return
compute the convex hull of a given set of points @param points @return
public static List<Point> convexHull(List<Point> points)
	{
		if (points.size() < 3)
		{
			return null;
		}
		List<Point> ch = new ArrayList<>();
		Point left = findLeftMost(points);
		Point current = left;
		do
		{
			ch.add(current);
			Point next = null;
			for (Point p : points)
			{
				if (next == null)
				{
					next = p;
					continue;
				}
				int cp = crossProduct(current, p, next);
				if (cp > 0 || (cp == 0 && current.distanceTo(p) > current.distanceTo(next)))
				{
					next = p;
				}
			}
			if (next == null)
			{
				return null;
			}
			assert ch.size() <= points.size() : "hull has more points than graph";
			current = next;
		}
		while (current != left);
		return ch;
	}
public static List < Point > convexHull ( List < Point > points ) { if ( points . size ( ) < 3 ) { return null ; } List < Point > ch = new ArrayList < > ( ) ; Point left = findLeftMost ( points ) ; Point current = left ; do { ch . add ( current ) ; Point next = null ; for ( Point p : points ) { if ( next == null ) { next = p ; continue ; } int cp = crossProduct ( current , p , next ) ; if ( cp > 0 || ( cp == 0 && current . distanceTo ( p ) > current . distanceTo ( next ) ) ) { next = p ; } } if ( next == null ) { return null ; } assert ch . size ( ) <= points . size ( ) : "hull has more points than graph" ; current = next ; } while ( current != left ) ; return ch ; }
compute the convex hull of a given set of points
 @param points
 @return
compute the convex hull of a given set of points @param points @return
// find the left most point // current point we are on // the next point - all points are to the right of the // line between current and next // Points can be null if they are behind or very close to the camera.