Compute the cross product of two 3-D vectors.
Returns the standard 3-D vector cross product
Parameters
Returns
TensorCross product, same shape as inputs.
Notes
Implemented via gather + element-wise products so that
autograd flows through naturally. Recall that
is orthogonal to both and ,
with magnitude .
Examples
>>> import lucid
>>> from lucid.linalg import cross
>>> cross(lucid.tensor([1.0, 0.0, 0.0]), lucid.tensor([0.0, 1.0, 0.0]))
Tensor([0.0000, 0.0000, 1.0000])