import { Coord } from "./coord"; import { Option } from "./option"; export declare function eqSet(xs: Set, ys: Set): boolean; /** * (1-t)^2 p0 + 2t(1-t)p1 + t^2 p2 */ export declare function bezierValue(t: number, p0: number, p1: number, p2: number): number; /** * Compute the binomial coefficient C(n,k) by recurrence * */ export declare function binomialCoef(n: number, k: number): number; /** * Compute B(t) where t is in [0,1] and B is a Bezier curve given by its list of points * @param t in [0,1] * @param points * @returns Sum( points[i]*t^i*Binom(n,i)) */ export declare function bezierCurvePoint(t: number, points: Array): Coord; export declare function solveLinearEquation2D(u: Coord, v: Coord, c: Coord): false | number[]; /** * Search for an intersection between the segments [a,b] and [c,d]. * Returns an Option with the coord of the intersection if it exists. */ export declare function isSegmentsIntersection(a: Coord, b: Coord, c: Coord, d: Coord): boolean; /** * UNTESTED * Search for an intersection between the segments [a,b] and [c,d]. * Returns an Option with the coord of the intersection if it exists. */ export declare function segmentsIntersection(a: Coord, b: Coord, c: Coord, d: Coord): Option; /** * UNTESTED * Search for an intersection between the segments ]a,b[ and ]c,d[. * Returns an Option with the coord of the intersection if it exists. */ export declare function segmentsInteriorIntersection(a: Coord, b: Coord, c: Coord, d: Coord): Option; /** * UNTESTED * Search for an intersection between the lines (AB) and (CD). * Returns an Option with the coord of the intersection if it exists. */ export declare function linesIntersection(a: Coord, b: Coord, c: Coord, d: Coord): Option; export declare function isPointInTriangle(point: Coord, q1: Coord, q2: Coord, q3: Coord): boolean; export declare function isTrianglesIntersection(p1: Coord, p2: Coord, p3: Coord, q1: Coord, q2: Coord, q3: Coord): boolean; export declare function isQuadraticBezierCurvesIntersection(p1: Coord, cp1: Coord, p2: Coord, q1: Coord, cp2: Coord, q2: Coord): boolean; /** * Returns the determinant of the matrix. * Algorithm: Leibniz formula (recursive). * @param matrix is supposed to be square and not of size 0 * No error are triggered it is not the case. */ export declare function det(matrix: Array>): number; /** * Return true if n is a square modulo m. * @param n integer * @param m integer * @example * isModSquare(4,5) == true // because 4 = 2^2 mod 5 * isModSquare(3,5) == false // because 0, 1 and 4 are the only squares in Z/5Z. */ export declare function isModSquare(n: number, m: number): boolean; export declare function booleanArrayToString(array: boolean[]): string; export declare function isPrime(num: number): boolean;