code: def radial_sort(points,
                  origin,
                  normal):
      
  
      # create two axis perpendicular to each other and the normal,
      # and project the points onto them
      axis0 = [normal[0], normal[2], -normal[1]]
      axis1 = np.cross(normal, axis0)
      ptVec = points - origin
      pr0 = np.dot(ptVec, axis0)
      pr1 = np.dot(ptVec, axis1)
  
      # calculate the angles of the points on the axis
      angles = np.arctan2(pr0, pr1)
  
      # return the points sorted by angle
      return points[[np.argsort(angles)]]
docs: Sorts a set of points radially (by angle) around an
      origin/normal.
  
      Parameters
      --------------
      points: (n,3) float, points in space
      origin: (3,)  float, origin to sort around
      normal: (3,)  float, vector to sort around
  
      Returns
      --------------
      ordered: (n,3) flot, re- ordered points in space