UNPKG

@thi.ng/vectors

Version:

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

36 lines 1.26 kB
import type { Comparator } from "@thi.ng/api"; import type { ReadonlyVec } from "./api.js"; /** * Returns a new 2D vector comparator using given component order. The * comparator returns the signed index+1 of the first differing * component, e.g. if order is `0,1`, a return value of -2 means that * `a.y < b.y`. * * @param o1 - * @param o2 - */ export declare const comparator2: (o1: number, o2: number) => Comparator<ReadonlyVec>; /** * Returns a new 3D vector comparator using given component order. The * comparator returns the signed index+1 of the first differing * component, e.g. if order is `0,1,2`, a return value of -3 means that * `a.z < b.z`. * * @param o1 - * @param o2 - * @param o3 - */ export declare const comparator3: (o1: number, o2: number, o3: number) => Comparator<ReadonlyVec>; /** * Returns a new 4D vector comparator using given component order. The * comparator returns the signed index+1 of the first differing * component, e.g. if order is `0,1,2,3`, a return value of -4 means * that `a.w < b.w`. * * @param o1 - * @param o2 - * @param o3 - * @param o4 - */ export declare const comparator4: (o1: number, o2: number, o3: number, o4: number) => Comparator<ReadonlyVec>; //# sourceMappingURL=compare.d.ts.map