eddymotion.math.utils module¶
- eddymotion.math.utils.compute_angle(v1, v2, closest_polarity=False)[source]¶
Compute the angle between two vectors.
- Parameters:
- Returns:
The angle between the two vectors in radians.
- Return type:
Examples
>>> compute_angle( ... np.array((1.0, 0.0, 0.0)), ... np.array((-1.0, 0.0, 0.0)), ... ) 3.1415... >>> compute_angle( ... np.array((1.0, 0.0, 0.0)), ... np.array((-1.0, 0.0, 0.0)), ... closest_polarity=True, ... ) 0.0
- eddymotion.math.utils.is_positive_definite(matrix)[source]¶
Check whether the given matrix is positive definite. Any positive definite matrix can be decomposed as the product of a lower triangular matrix and its conjugate transpose by performing the Cholesky decomposition. :Parameters: matrix (
ndarray
) – The matrix to check.- Return type:
True is the matrix is positive definite; False otherwise