cross_vectors

compas.geometry.cross_vectors(u, v)[source]

Compute the cross product of two vectors.

Parameters
Returns

[float, float, float] – The cross product of the two vectors.

Notes

The xyz components of the cross product of two vectors u and v can be computed as the minors of the following matrix:

[xyzuxuyuzvxvyvz]

Therefore, the cross product can be written as:

u×v=[uyvzuzvyuzvxuxvzuxvyuyvx]

Examples

>>> cross_vectors([1.0, 0.0, 0.0], [0.0, 1.0, 0.0])
[0.0, 0.0, 1.0]