UNPKG

@thi.ng/vectors

Version:

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

10 lines (9 loc) 308 B
import { sign } from "@thi.ng/math/abs"; import { EPS } from "@thi.ng/math/api"; import { signedArea2 } from "./signed-area.js"; const corner2 = (a, b, c, eps = EPS) => sign(signedArea2(a, b, c), eps); const clockwise2 = (a, b, c, eps = EPS) => corner2(a, b, c, eps) < 0; export { clockwise2, corner2 };