cross
Computes the cross product of two three-dimensional vectors.
Concrete Vector operands must each contain exactly three elements. The result is a Vector perpendicular to the two input vectors. Symbolic non-vector operands can remain as an unevaluated cross call.
Examples
These examples use Nerdamer Notation.
Compute the cross product of the first two standard basis vectors.
cross([1,0,0],[0,1,0])
// → [0, 0, 1]Compute a three-dimensional cross product with symbolic components.
cross([a,b,c],[x,y,z])
// → [b*z-c*y, c*x-a*z, a*y-b*x]Interfaces
The same operation is available through the interfaces below.
Nerdamer Notation
Use this form inside input passed to nerdamer(...).
cross(arg1, arg2)
nerdamer.cross
Call the operation through the default nerdamer import.
nerdamer.cross(a: Vector, b: Vector): Vector
nerdamer.cross(a: Expression, b: Expression): Expression
nerdamer.cross(a: ParserEntity, b: ParserEntity): Expression | Vector
Parameters
Returns
Vector — The Vector cross product, or an unevaluated cross(a, b) Expression
when both operands are Expressions.
Direct JavaScript / TypeScript API
Import the operation directly from its package entry point.
import { cross } from 'nerdamer/structures';
cross(a: Vector, b: Vector): Vector
cross(a: Expression, b: Expression): Expression
cross(a: ParserEntity, b: ParserEntity): Expression | Vector
Parameters
Returns
Vector — The Vector cross product, or an unevaluated cross(a, b) Expression
when both operands are Expressions.
