UNPKG

@sgratzl/science

Version:

Scientific and statistical computing in JavaScript.

10 lines (9 loc) 227 B
export default function cross(a, b) { // TODO how to handle non-3D vectors? // TODO handle 7D vectors? return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ]; };