ivy.cross(x1: ivy.NativeArray, x2: ivy.NativeArray, f: Optional[ivy.Framework] = None) → ivy.NativeArray[source]

Returns the cross product of two (arrays of) vectors in R^3. The cross product of x1 and x2 in R^3 is a vector perpendicular to both x1 and x2. If x1 and x2 are arrays of vectors, the vectors are defined by the last axis of x1 and x2 by default which must have dimension 3.

  • x1 (array) – Components of the first vector(s).

  • x2 (array) – Components of the second vector(s).

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.


Vector cross product(s).

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty