Coverage for lingpy/compare/_phylogeny/convex_hull.py : 95%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Compute the convex hull for a given set of points.
Notes -----
This code has been taken from: http://www.scipy.org/Cookbook/Finding_Convex_Hull
Author: Angus McMorland Date: 2007-08-16 """
except ImportError: log.missing_module('matplotlib')
'''calculate angle in 2-D between points and x axis'''
'''calculate area of any triangle given co-ordinates of the corners'''
""" Calculate subset of points that make a convex hull around points
Notes ----- Recursively eliminates points that lie inside two neighbouring points until only convex hull is remaining.
Parameters ---------- points : ndarray (2 x m) array of points for which to find hull graphic : bool use pylab to show progress? smidgen : float offset for graphic number labels - useful values depend on your data range
Returns ------- hull_points : ndarray (2 x n) convex hull surrounding points """ return points '%d' % i) pts[(i + 2) % n_pts]) facecolor='blue', alpha=0.2) pts[(i + 2) % n_pts], facecolor='green', alpha=0.2) centre, pts[i], pts[(i + 2) % n_pts], facecolor='red', alpha=0.2) |