math¶
This module provides a collection of jitted (using njit()) functions for mathematical and geometrical operations.
- as_angle(vectors)¶
Represent vectors as angles in radians on the unit circle.
Note that input vectors do not need to be unit vectors. Zero-magnitude vectors result in
np.nanvalues.
- as_unit_vector(radians)¶
Unit vectors representing angles in radians on the unit circle.
- dot_product(vectors_1, vectors_2)¶
Dot product between two vector arrays.
- euclidean_distance(array_1, array_2)¶
Euclidean distance between two vector arrays.
- magnitude(vectors)¶
Vector magnitudes.
- perp(vectors)¶
Perpendicular vectors (rotated counterclockwise).
- perp_dot_product(vectors_1, vectors_2)¶
Perpendicular dot product between two vector arrays.
- projection(vectors_1, vectors_2)¶
Projection vectors of
vectors_1ontovectors_2.
- rejection(vectors_1, vectors_2)¶
Rejection vectors of
vectors_1fromvectors_2.
- rotate(vectors, angles)¶
Rotate vectors around angles in radians.
- scalar_projection(vectors_1, vectors_2)¶
Scalar projection of
vectors_1ontovectors_2.
- scalar_rejection(vectors_1, vectors_2)¶
Scalar rejection of
vectors_1fromvectors_2.
- shift(array, step)¶
Similar to
numpy.roll()on axis 0 (shift to right with step > 0, shift to left with step < 0).Values are filled with the last value (shift to left) or the first value (shift to right), no wrapping.
- signed_angle(vectors_1, vectors_2)¶
Signed angles between vectors.
See
as_angle()for behavior with zero-magnitude input vectors.
- subtract(array_1, array_2)¶
Subtract
array_2fromarray_1.
- unit_vector(vectors)¶
Vectors to unit vectors.
- unsigned_angle(vectors_1, vectors_2)¶
Unsigned angles between vectors.
Returns
np.nanvalues when either input is of zero-magnitude.