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 arrayofshape (...,2)or(...,3)) – points to be sortedaxis (
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