Type Aliases

A collection of aliases to simplify type hinting.

This is primarily to make type hinting NumPy arrays easier.

Utils

A collection of helper functions commonly used by the other modules.

wrap()

Wraps value(s) between the lower (inclusive) and upper (exclusive) bounds.

Supports x as a NumPy array of values to be wrapped.

Arguments:

Returns:

If the argument x passed in was a float, returns the wrapped float of x.

If the argument x passed in was a NumPy array of floats, returns an array of floats in same shape where each element is wrapped.

linearInterpExtrap()

Linearly interpolate or extrapolate at the point x from the closest 2 data points defined by xp, fp.

Able to compute linear extrapolation unlike NumPy interp(). For computing single points, faster than NumPy interp() if there is a reasonable chance (>15%) that the point will be calculated using the first pair or last pair of data points.

Arguments:

Returns:

Extrapolated function at point x.

getHeading()

Calculates the heading angle(s) of the vector(s), only in the [x, y] plane.

Supports xy_xyz as a NumPy array of coordinates.

Arguments:

Returns:

Heading angle (if xy_xyz was a 1D array) or NumPy array of heading angles (if xy_xyz was a 2D array).

The heading angle is from -pi to pi radians, increasing clockwise with 0 corresponding to the direction [0, 1].

Raises: