theta = 0.5 * np.arctan2(b, a - c)
w = np.sqrt(6 * (a + c - np.sqrt(b ** 2 + (a - c) ** 2)))
l = np.sqrt(6 * (a + c + np.sqrt(b ** 2 + (a - c) ** 2)))
return l, w, theta
Counting pixels within an Ellipse from a numpy array