Suppose I have a ndarray of coordinates of shape (n, 2) where each coordinate is (x, y).
X = np.random.random(shape) * 10 # just to gener