Fitting Module

Implements the quickhull algorithm for computing the convex hull of a set of points in 2D space.

Used as source: https://stackoverflow.com/questions/74812556/computing-quick-convex-hull-using-numba

Read more about the quickhull algorithm: https://surface.syr.edu/eecs_techreports/65/

argmin(vals: List[float]) int[source]

Return the index of the minimum value in a list of floats.

Parameters:

vals (list[float]) – The list of floats.

Returns:

The index of the minimum value in the list.

Return type:

int

argmax(vals: List[float]) int[source]

Return the index of the maximum value in a list of floats.

Parameters:

vals (list[float]) – The list of floats.

Returns:

The index of the maximum value in the list.

Return type:

int

arange(n: int) List[int][source]

Return a list of integers from 0 to n-1.

Parameters:

n (int) – The number of integers to return.

Returns:

The list of integers.

Return type:

list[int]

process(points: List[Point2D], indices_of_points_to_consider: List[int], index_a: int, index_b: int) List[int][source]

Recursively computes the convex hull of a set of points in 2D space.

Parameters:
  • points (list[Point2D]) – The list of points.

  • indices_of_points_to_consider (list[int]) – The indices of the points to consider.

  • index_a (int) – The index of the first point.

  • index_b (int) – The index of the second point.

Returns:

The convex hull of the set of points.

Return type:

list[int]

calculate_convex_hull(points: List[Point2D]) List[int][source]

Calculate the convex hull of a set of points in 2D space.

Parameters:

points (list[Point2D]) – The list of points.

Returns:

The convex hull of the set of points.

Return type:

list[int]