@thi.ng/vectors
Version:
Optimized 2d/3d/4d and arbitrary length vector operations, support for memory mapping/layouts
9 lines (8 loc) • 343 B
JavaScript
import { direction2 } from "./direction.js";
import { perpendicularCCW, perpendicularCW } from "./perpendicular.js";
const normalCCW = (out, a, b, n = 1) => perpendicularCCW(null, direction2(out || [], a, b, n));
const normalCW = (out, a, b, n = 1) => perpendicularCW(null, direction2(out || [], a, b, n));
export {
normalCCW,
normalCW
};