cross — Python array API standard 2024.12 documentation (original) (raw)

cross(x1: array, x2: array, /, *, axis: int = -1) → array

Returns the cross product of 3-element vectors.

If x1 and/or x2 are multi-dimensional arrays (i.e., the broadcasted result has a rank greater than 1), then the cross-product of each pair of corresponding 3-element vectors is independently computed.

Parameters:

Returns:

out (array) – an array containing the cross products. The returned array must have a data type determined by Type Promotion Rules.

Notes

Raises

Changed in version 2022.12: Added support for broadcasting.

Changed in version 2022.12: Added complex data type support.

Changed in version 2023.12: Restricted broadcasting to only non-compute axes and required that axis be a negative integer.