gaitmap.utils.vector_math.find_orthogonal#

gaitmap.utils.vector_math.find_orthogonal(v1: ndarray, v2: ndarray) ndarray[source]#

Return an orthogonal vector to 2 vectors.

Parameters:
v1vector with shape (3,)

axis ([x, y ,z])

v2vector with shape (3,)

axis ([x, y ,z])

Returns:
Returns the cross product of the two if they are not equal.
Returns a random vector in the perpendicular plane if they are either parallel or antiparallel.
(see find_random_orthogonal

Examples

>>> find_orthogonal(np.array([1, 0, 0]), np.array([-1, 0, 0]))
array([0, 0, -1])