A collection of aliases to simplify type hinting.
This is primarily to make type hinting NumPy arrays easier.
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:
x: Float or NumPy array of floats to wrap.lowerBound: Lower bound for the wrapping. This bound is inclusive.upperBound: Upper bound for the wrapping. This bound is exclusive.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:
x: x coordinate to evaluate the extrapolated functionxp: x coordinates of the function. Must contain 2 or more elements and be monotonically increasing (though not validated explicitly).fp: Function values corresponding to the x coordinates of xp. Must be the same size as xp.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:
xy_xyz: Vector or NumPy array of vectors, where each vector is in the form [x, y] or [x, y, z].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:
ValueError: If the argument xy_xyz doesn’t have a dimension of 1 or 2.