resqpy.olio.vector_utilities.xy_sorted

resqpy.olio.vector_utilities.xy_sorted(p, axis=None)[source]

Returns copy of points p sorted according to x or y (whichever has greater range).

Parameters
  • p (numpy float array of shape (..., 2) or (..., 3)) – points to be sorted

  • axis (int, optional) – 0 for x sort; 1 for y sort; None for whichever has greater range

Returns

p’, axis where p’ is a list-like (2D) version of p, sorted by either x or y and axis is 0 if the sort was by x, 1 if it were by y

Note

returned array is always 2D, ie. list of points