type Quat = readonly [number, number, number, number] | readonly number[]; /** * Multiplicative inverse of a quaternion: `conj(q) / |q|²`. For unit * quaternions this equals the conjugate. * * @example * quaternionInverse([0, 1, 0, 0]) // [0, -1, 0, 0] */ export declare function quaternionInverse(q: Quat): number[]; /** * Spherical linear interpolation between two (unit) quaternions, `t ∈ [0,1]`. * Chooses the shortest arc (negating `q2` when the dot product is negative) * and falls back to normalized linear interpolation (nlerp) when the inputs * are nearly parallel, where the slerp coefficients become numerically * unstable. * * @example * quaternionSlerp([1,0,0,0], [0,1,0,0], 0) // [1,0,0,0] * quaternionSlerp([1,0,0,0], [0,1,0,0], 1) // [0,1,0,0] */ export declare function quaternionSlerp(q1: Quat, q2: Quat, t: number): number[]; /** * Convert a (unit) quaternion `[w, x, y, z]` to ZYX intrinsic Euler angles * `[roll, pitch, yaw]` in radians (the standard aerospace yaw-pitch-roll * sequence). Pitch is clamped at the ±90° gimbal-lock singularity. * * @example * quaternionToEuler([1, 0, 0, 0]) // [0, 0, 0] */ export declare function quaternionToEuler(q: Quat): [number, number, number]; /** * Quaternion logarithm. For a unit quaternion `q = (w, v)`: * `log(q) = (0, θ·û)` where `θ = atan2(|v|, w)` and `û = v/|v|`. * The zero-vector-part (real/identity) case returns the zero quaternion * rather than dividing by zero. * * @example * quaternionLog([1, 0, 0, 0]) // [0, 0, 0, 0] */ export declare function quaternionLog(q: Quat): number[]; /** * Quaternion exponential. For `q = (w, v)`: * `exp(q) = eʷ · (cos|v|, sin|v|·v/|v|)` (the pure-quaternion case `w = 0` * reduces to `exp((0, u)) = (cos|u|, sin|u|·û)`, the standard exponential map * used to invert {@link quaternionLog}). * * @example * quaternionExp([0, 0, 0, 0]) // [1, 0, 0, 0] */ export declare function quaternionExp(q: Quat): number[]; /** * Quaternion power: `pow(q, t) = exp(t · log(q))`. For a unit quaternion * representing a rotation, this interpolates/extrapolates the rotation angle * by factor `t` about the same axis (`t=1` returns `q`; `t=0` returns the * identity `[1, 0, 0, 0]`; `t=2` doubles the rotation). * * @example * quaternionPow([0.70710678, 0, 0, 0.70710678], 0.5) // [0.92387953, 0, 0, 0.38268343] */ export declare function quaternionPow(q: Quat, t: number): number[]; /** * Axis-aligned bounding box (per-dimension min/max) of a set of nD points. * * @example * boundingBox([[1,2],[3,0],[2,5]]) // { min: [1,0], max: [3,5] } */ export declare function boundingBox(points: number[][]): { min: number[]; max: number[]; }; /** Result of {@link procrustes}: best-fit rotation, uniform scale, and residual. */ export interface ProcrustesResult { /** Orthogonal `d x d` rotation (or reflection) matrix. */ R: number[][]; /** Optimal uniform scale factor. */ scale: number; /** Residual sum of squares after alignment (centered + unit-normalized inputs). */ disparity: number; } /** * Orthogonal Procrustes alignment: find the rotation `R`, uniform scale * `scale`, and residual `disparity` that best map `B` onto `A` after both are * centered on their centroid and normalized to unit Frobenius norm. * * Algorithm: `A0`, `B0` = centered + unit-normalized `A`, `B`; * `M = A0ᵀ B0 = U Σ Vᵀ` (SVD); `R = V Uᵀ` (minimizes `‖B0 R − A0‖`); * `scale = Σ Σᵢ` (sum of singular values); `disparity = ‖A0 − scale·B0·R‖²`. * Pinned against `scipy.spatial.procrustes` (disparity matches to float * precision for both exact-rotation and unrelated-point-set inputs). * * @example * procrustes([[0,0],[1,0],[0,1]], [[0,0],[0,1],[-1,0]]) * // R ~ 90° rotation, disparity ~ 0 */ export declare function procrustes(A: number[][], B: number[][]): ProcrustesResult; /** * Indices of the `k` nearest points to `query` (Euclidean distance, * nearest-first). Brute-force — see `../ml/dbscan-knn.ts` for the same * strategy used by the k-NN classifier/regressor. * * @example * kdTreeKNN([[0,0],[1,0],[5,5]], [0,0], 2) // [0, 1] */ export declare function kdTreeKNN(points: number[][], query: number[], k: number): number[]; /** * Indices of all points within Euclidean radius `r` of `query` (brute force). * * @example * kdTreeRadius([[0,0],[1,0],[5,5]], [0,0], 2) // [0, 1] */ export declare function kdTreeRadius(points: number[][], query: number[], r: number): number[]; /** * True when every element of `b` (with multiplicity) appears in `a` — i.e. * `a` is a (multiset) superset of `b`. Complement of `setIsSubset`. * * @example * setIsSuperset([1, 2, 3], [1, 2]) // true * setIsSuperset([1, 2], [1, 2, 3]) // false */ export declare function setIsSuperset(a: unknown[], b: unknown[]): boolean; /** * True when `a` and `b` are equal as multisets (same elements, same * multiplicities, order-independent). * * @example * setEqual([1, 2, 2], [2, 1, 2]) // true * setEqual([1, 2], [1, 2, 2]) // false */ export declare function setEqual(a: unknown[], b: unknown[]): boolean; /** * True when `a` and `b` share no elements (multiset intersection is empty). * * @example * setDisjoint([1, 2], [3, 4]) // true * setDisjoint([1, 2], [2, 3]) // false */ export declare function setDisjoint(a: unknown[], b: unknown[]): boolean; export {}; //# sourceMappingURL=geometry-extra.d.ts.map