/**
 * pacem v0.51.10-faraday (https://js.pacem.it)
 * Copyright 2025 Pacem (https://pacem.it)
 * Licensed under Apache-2.0
 */
declare namespace Pacem.Geometry.LinearAlgebra {
    interface Vector extends Point {
    }
    class Vector {
        static unit(v: Vector): Vector;
        static magSqr(v: Vector): number;
        static mag(v: Vector): number;
        static normalize(v: Vector): void;
        static from(p1: Point, p2: Point): Vector;
        static dot(v1: Point, v2: Point): number;
        static cross(v1: Point, v2: Point): number;
    }
}
declare namespace Pacem.Geometry {
    type Segment = [Point, Point];
    class Utils {
        static slopeRad(p1: Point, p2: Point): number;
        static slopeRad2(p1: Point, p2: Point): number;
        static slopeDeg(p1: Point, p2: Point): number;
        static slopeDeg2(p1: Point, p2: Point): number;
        static intersect(...rects: Rect[]): Rect;
        static intersect(segment1: Segment, segment2: Segment): Point;
        static intersectLines(segment1: Segment, segment2: Segment): Point;
        static intersectLines(m1: number, q1: number, m2: number, q2: number): Point;
        static intersectLines(mq1: [number, number], mq2: [number, number]): Point;
        static cramer(l1: [number, number, number], l2: [number, number, number]): Point;
        static cramer(l1: {
            a: number;
            b: number;
            c: number;
        }, l2: {
            a: number;
            b: number;
            c: number;
        }): Point;
        static mq(p1: Point, p2: Point): [number, number];
        static mq(segment: Segment): [number, number];
        private static _intersectSegments;
        private static _intersectRects;
        static dot(v1: Point, v2: Point): number;
        static cross(v1: Point, v2: Point): number;
        static distance(p1: Point, p2: Point): number;
        static distance(p: Point, mq: [number, number]): number;
        static distance(segment: Segment): number;
        static inLine(p: Point, segment: Segment): boolean;
        static inSegment(p: Point, segment: Segment): boolean;
        static inTriangle(p: Point, triangle: [Point, Point, Point]): boolean;
        static inPolygon(p: Point, vertices: Point[]): any;
        static inPolygon(p: Point, vertices: Point[], precision: number): any;
        static area(points: Point[]): number;
        static area(...points: Point[]): number;
    }
}
declare namespace Pacem.Geometry.LinearAlgebra {
    interface Point3D {
        x: number;
        y: number;
        z: number;
    }
    interface Vector3D extends Point3D {
    }
    class Vector3D {
        static from(...args: number[]): Vector3D;
        static parse(input: string): Vector3D;
        static i(): Vector3D;
        static j(): Vector3D;
        static k(): Vector3D;
        static zero(): Vector3D;
        static subtract(p: Point3D, from: Point3D): Point3D;
        static add(...points: Point3D[]): Point3D;
        static dot(v1: Point3D, v2: Point3D): number;
        static cross(v1: Point3D, v2: Point3D): Vector3D;
        static scale(v: Vector3D, f: number): Vector3D;
        static scale(v: Vector3D, fx: number, fy: number, fz: number): Vector3D;
        static magSqr(v: Point3D): number;
        static mag(v: Point3D): number;
        static negate(v: Vector3D): Vector3D;
        static unit(v: Vector3D): Vector3D;
        static normalize(v: Vector3D): void;
        static angleBetween(vector1: Vector3D, vector2: Vector3D): number;
    }
    interface Spherical {
        theta: number;
        phi: number;
        rho: number;
    }
    class Spherical {
        static from(rho: number, theta: number, phi: number): Spherical;
        static fromVector(x: number, y: number, z: any): Spherical;
        static fromVector(v: Vector3D): Spherical;
        static toVector(coords: Spherical): Vector3D;
        static toRotationMatrix(coords: Spherical): Matrix3D;
        static toRotationMatrix(coords: {
            theta: number;
            phi: number;
        }): Matrix3D;
    }
    interface Matrix3D {
        m11: number;
        m12: number;
        m13: number;
        m14: number;
        m21: number;
        m22: number;
        m23: number;
        m24: number;
        m31: number;
        m32: number;
        m33: number;
        m34: number;
        offsetX: number;
        offsetY: number;
        offsetZ: number;
        m44: number;
    }
    class Matrix3D {
        static identity(): Matrix3D;
        static from(...args: number[]): Matrix3D;
        static transpose(m: Matrix3D): Matrix3D;
        static toArray(m: Matrix3D): number[];
        static clone(m: Matrix3D): Matrix3D;
        static clone(m: Matrix3D, modifier: (m: Matrix3D) => void): Matrix3D;
        static scale(m: Matrix3D, v: Vector3D): Matrix3D;
        static scale(m: Matrix3D, scale: number): Matrix3D;
        static scale(m: Matrix3D, sx: number, sy: number, sz: number): Matrix3D;
        static translate(m: Matrix3D, offset: Vector3D): Matrix3D;
        static parse(input: string): Matrix3D;
        static isIdentity(m: Matrix3D): boolean;
        static isAffine(m: Matrix3D): boolean;
        static determinant(m: Matrix3D): number;
        static multiply(...matrices: Matrix3D[]): Matrix3D;
        static invert(m: Matrix3D): Matrix3D;
        static transform(point: Point3D, matrix: Matrix3D): Point3D;
    }
    interface Quaternion {
        x: number;
        y: number;
        z: number;
        w: number;
    }
    class Quaternion {
        static identity(): Quaternion;
        static from(...args: number[]): Quaternion;
        static parse(input: string): Quaternion;
        static fromVectors(from: Vector3D, to: Vector3D): Quaternion;
        static normalize(q: Quaternion): void;
        static unit(q: Quaternion): Quaternion;
        static fromAxisAngle(axis: Vector3D, angleDeg: number): Quaternion;
        static fromRotationMatrix(rotationMatrix: Matrix3D): Quaternion;
        static conjugate(q: Quaternion): Quaternion;
        static mag(q: Quaternion): number;
        static norm(q: Quaternion): number;
        static axis(q: Quaternion): Vector3D;
        static transform(v: Vector3D, q: Quaternion): Vector3D;
        static angle(q: Quaternion): number;
        static toRotationMatrix(q: Quaternion): Matrix3D;
        static invert(q: Quaternion): Quaternion;
        static multiply(q1: Quaternion, q2: Quaternion): Quaternion;
        static dot(q1: Quaternion, q2: Quaternion): number;
    }
}
declare namespace Pacem.Geometry {
    type Point3D = Pacem.Geometry.LinearAlgebra.Point3D;
    export type Ray = [Point3D, Point3D];
    export class Utils3D {
        static intersect(ray: Ray, triangle: [Point3D, Point3D, Point3D]): Point3D | null;
    }
    export {};
}
declare namespace Pacem.Geometry {
    interface Polygon {
        vertices: Point[];
    }
    class Polygon {
        static isPolygon(obj: any): obj is Polygon;
        static from(...points: Point[]): Polygon;
        static contains(polygon: Polygon, p: Point): any;
        static centroid(polygon: Polygon): Point;
        static boundingBox(polygon: Polygon): Rect;
        static sides(polygon: Polygon): Segment[];
        static isConvex(polygon: Polygon): boolean;
        static isSelfIntersecting(polygon: Polygon): boolean;
        static isCounterClockwise(polygon: Polygon): boolean;
        static expand(polygon: Polygon, offset: number): Polygon;
        static area(polygon: Polygon): number;
    }
}
declare namespace Pacem.Mathematics {
    interface Complex {
        readonly real: number;
        readonly img: number;
    }
    class Complex {
        static build(z: Complex | number): Complex;
        static build(real: number, img: number): Complex;
        static add(a: Complex | number, b: Complex | number): Complex;
        static subtract(from: Complex | number, what: Complex | number): Complex;
        static multiply(a: Complex | number, b: Complex | number): Complex;
        static divide(a: Complex | number, b: Complex | number): Complex;
        static absSquare(c: Complex | number): number;
        static modulus(c: Complex | number): number;
        static isComplex(c: any): c is Complex;
        static conjugate(a: Complex | number): Complex;
        static equals(c1: Complex | number, c2: Complex | number): boolean;
        static get NaC(): Complex;
    }
}
declare namespace Pacem.Mathematics.DataAnalysis {
    class Fourier {
        static transform(data: (Complex | number)[], normalize?: boolean): Complex[];
        static invert(data: Complex[], normalize?: boolean): Complex[];
        static dft(data: (Complex | number)[], normalize?: boolean): Complex[];
        static idft(data: Complex[], normalize?: boolean): Complex[];
        static fft(data: (Complex | number)[], normalize?: boolean): Complex[];
    }
}
declare namespace Pacem.Mathematics.DataAnalysis {
    class Gaussian {
        constructor(mean: number, stdev: number);
        readonly mean: number;
        readonly stdev: number;
        readonly variance: number;
        static get normal(): Gaussian;
        weight(x: number): number;
        probabilityDensity(x: number): number;
        private _z;
        probability(x: number): number;
    }
}
declare namespace Pacem.Mathematics.DataAnalysis {
    type Polynomial = (x: number) => number;
    class Lagrangian {
        #private;
        private constructor();
        private _unsafeCreate;
        private _compute;
        interpolate(x: number): number;
        static create(...values: number[]): Lagrangian;
        static create(...points: Point[]): Lagrangian;
        static create(points: Point[]): Lagrangian;
        static create(values: number[]): Lagrangian;
    }
}
declare namespace Pacem.Mathematics.NumberTheory {
    class Utils {
        static lcd(...args: number[]): number;
        static gcd(a: number, b: number): any;
        static rebaseInt(v: number | string, from: number, to: number): string;
        static rebaseFloat(v: number | string, fromRadix: number, toRadix: number, precision?: number): string | number;
        static rebaseFloatNTo10(v: string, radix: number, precision?: number): number;
        static rebaseFloat10ToNIntBase(v: number, radix: number, precision?: number): string;
        static rebaseFloat10ToN(v: number, radix: number, precision?: number): string;
    }
}
declare namespace Pacem.Mathematics.DataAnalysis {
    type NumericKeySelector<T> = (item: T, index?: number) => number;
    export class Utils {
        static sum<T>(set: T[], selector: NumericKeySelector<T>): number;
        static sum(set: number[]): number;
        static mean<T>(set: T[], selector: NumericKeySelector<T>): number;
        static mean(set: number[]): number;
        static median<T>(set: T[], selector: NumericKeySelector<T>): number;
        static median(set: number[]): number;
        static mode<T>(set: T[], selector: NumericKeySelector<T>): number;
        static mode(set: number[]): number;
        static var<T>(set: T[], selector: NumericKeySelector<T>): number;
        static var(set: number[]): number;
        static varp<T>(set: T[], selector: NumericKeySelector<T>): number;
        static varp(set: number[]): number;
        static stdevp<T>(population: T[], selector: NumericKeySelector<T>): number;
        static stdevp(population: number[]): number;
        static stdev<T>(set: T[], selector: NumericKeySelector<T>): number;
        static stdev(set: number[]): number;
        static correlation(setX: number[], setY: number[]): number;
        static correlation<X, Y>(setX: X[], setY: Y[], selectorX: NumericKeySelector<X>, selectorY: NumericKeySelector<Y>): number;
        static correlation<T>(set: T[], selectorX: NumericKeySelector<T>, selectorY: NumericKeySelector<T>): number;
        static linearRegression(setX: number[], setY: number[]): [number, number];
        static linearRegression<X, Y>(setX: X[], setY: Y[], selectorX: NumericKeySelector<X>, selectorY: NumericKeySelector<Y>): [number, number];
        static linearRegression(set: Point[]): [number, number];
        static linearRegression<T>(set: T[], selectorX: NumericKeySelector<T>, selectorY: NumericKeySelector<T>): [number, number];
        static gaussian(mean: number, stdev: number): Gaussian;
    }
    export type SearchFunction = (min: number, max: number, weight: (v: number) => number, tolerance?: number) => number;
    export const SearchFunctions: {
        linear: (segments?: number) => SearchFunction;
        goldenRatio: SearchFunction;
        gaussian: SearchFunction;
    };
    export {};
}
