@thi.ng/geom
Version:
Functional, polymorphic API for 2D geometry types & SVG generation
34 lines • 1.05 kB
TypeScript
import type { MultiFn2O } from "@thi.ng/defmulti";
import type { IShape } from "./api.js";
import type { ReadonlyVec } from "@thi.ng/vectors";
/**
* Classifies point `p` with respect to given shape. Returns -1 if `p` is
* inside, 1 if outside or 0 if `p` is on the shape boundary (using optional
* tolerance `eps`, default: 1e-6).
*
* @remarks
* Currently only implemented for:
*
* - {@link Circle}
* - {@link Line} (-1 = right/clockwise, +1 = left/counterclockwise)
* - {@link Plane} (-1 = below, +1 = above)
* - {@link Polygon}
* - {@link Sphere}
* - {@link Triangle}
*
* The [thi.ng/geom-sdf](https://thi.ng/thi.ng/geom-sdf) package provides a much
* more comprehensive feature set (incl. support for more shapes) to perform
* similar checks as this function.
*
* Also see:
*
* - {@link closestPoint}
* - {@link pointInside}
* - {@link proximity}
*
* @param shape
* @param p
* @param eps
*/
export declare const classifyPoint: MultiFn2O<IShape, ReadonlyVec, number, number>;
//# sourceMappingURL=classify-point.d.ts.map