Methods
1. KPS(P)
Description: Computes the convex hull using the Kirkpatrick-Seidel algorithm.
Parameters: P: Array of points.
Returns: Array of points representing the vertices of the convex hull.
2. UpperHull(P)
Description: Computes the upper hull of a set of points.
Parameters: P: Array of points.
Returns: None
3. connect(k, m, S)
Description: Connects two points on the convex hull.
Parameters: k, m: Points to connect.
S: Subset of points.
Returns: None
4. bridge(S, a)
Description: Finds the bridge in a set of points.
Parameters: S: Array of points.
a: Parameter for the bridge calculation.
Returns: Array containing the two points forming the bridge.
5. slowMedian(S)
Description: Finds the median of a set of points using a slow method.
Parameters: S: Array of points.
Returns: Point representing the median.
6. findMedian(S)
Description: Finds the median of a set of points.
Parameters: S: Array of points.
Returns: Point representing the median.
7. quickSelect(A, k)
Description: Finds the k-th smallest element in an array.
Parameters: A: Array of points.
k: Index of the desired element.
Returns: The k-th smallest element.
8. medianOfMedians(A)
Description: Finds the median of medians of an array.
Parameters: A: Array of points.
Returns: The median of medians.
9. chunked(A, chunk_size)
Description: Divides an array into chunks of a specified size.
Parameters: A: Array of points.
chunk_size: Size of each chunk.
Returns: Array of chunks.
10. deepClone(P)
Description: Creates a deep copy of an array of points.
Parameters: P: Array of points.
Returns: Deep copy of the array.
11. mirror(P)
Description: Mirrors a set of points.
Parameters: P: Array of points.
Returns: Mirrored set of points.