UNPKG

@thi.ng/vectors

Version:

Optimized 2d/3d/4d and arbitrary length vector operations, support for memory mapping/layouts

12 lines (11 loc) 276 B
import { atan2Abs } from "@thi.ng/math/angle"; const headingXY = (a) => atan2Abs(a[1], a[0]); const headingXZ = (a) => atan2Abs(a[2], a[0]); const headingYZ = (a) => atan2Abs(a[2], a[1]); const heading = headingXY; export { heading, headingXY, headingXZ, headingYZ };