cross

Navigation:  Language Reference > Functions > Matrix >

cross

Previous pageReturn to chapter overviewNext page

Syntax

Y = cross(A,B);

Description

This functions returns the vector cross product of the vectors A and B. That is Y = A × B or:

 

Y[1] = A[2]*B[3] - A[3]*B[2]

Y[2] = A[3]*B[1] - A[1]*B[3]

Y[3] = A[1]*B[2] - A[2]*B[1]

Examples

parameters

 real A[3] = [1;2;3];

 real B[3] = [4;5;6];

variables

 real Y[3];

equations

Y = Cross(A,B); // Y = [-3;6;-3]

Limitations

Y, A and B must be column vectors of size 3.