Skip to content

Cross Product

The Cross Product block returns a × b, the vector perpendicular to both inputs.

y = cross(a, b)

Port Direction Type
0, 1 Input The same 3-element array, [f64; 3] by default
0 Output Same type as inputs

The block follows the type wired into it, so [f32; 3] works too. Any length other than 3 is a compile error.

None.

A magnetic dipole m = [1.0, 0.0, 0.0] in a field b = [0.0, 0.0, 2.0] feels the torque y = [0.0, -2.0, 0.0].