rot90

compas.numerical.rot90(vectors, axes)[source]

Rotate an array of vectors through 90 degrees around an array of axes.

Parameters
• vectors (array) – An array of row vectors (m x 3).

• axes (array) – An array of axes (m x 3).

Returns

array – Matrix of row vectors (m x 3).

Notes

Computes the cross product of each row vector with its corresponding axis, and then rescales the resulting normal vectors to match the length of the original row vectors.

Examples

>>> vectors = array([[2, 1, 3], [2, 6, 8]])
>>> axes = array([[7, 0, 1], [4, 4, 2]])
>>> rot90(vectors, axes)
array([[-0.18456235, -3.50668461,  1.29193644],
[ 5.3748385 , -7.5247739 ,  4.2998708 ]])