Navigation

Operators and Keywords

Function List:

C++ API

: cross (x, y)
: cross (x, y, dim)

Compute the vector cross product of two 3-dimensional vectors x and y.

If x and y are matrices, the cross product is applied along the first dimension with three elements.

The optional argument dim forces the cross product to be calculated along the specified dimension.

Example Code:

cross ([1,1,0], [0,1,1])
     ⇒ [ 1; -1; 1 ]

See also: dot, curl, divergence.

Package: octave