{"version":3,"file":"quadratic-DPrUsFCp.mjs","names":["internal.isLinearPolynomial","equals","internal.equals","make","internal.make","fromVector","internal.fromVector","internal.fromPointSlope","fromPoints","internal.fromPoints","solve","internal.solve","toSolver","internal.toSolver","solveInverse","internal.solveInverse","toInverseSolver","internal.toInverseSolver","monotonicity","internal.monotonicity","isMonotonic","internal.isMonotonic","isIncreasing","internal.isIncreasing","isDecreasing","internal.isDecreasing","asMonotonic","internal.asMonotonic","asIncreasing","internal.asIncreasing","asDecreasing","internal.asDecreasing","coefficients","internal.coefficients","derivative","internal.derivative","antiderivative","internal.antiderivative","domain","internal.domain","range","internal.range","unitRange","internal.unitRange","length","internal.length","internal.isQuadraticPolynomial","internal.equals","internal.make","internal.fromVector","internal.fromPoints","internal.solve","internal.toSolver","internal.solveInverse","internal.toInverseSolver","internal.coefficients","internal.derivative","internal.roots","internal.extreme","internal.monotonicity","internal.isMonotonic","internal.isIncreasing","internal.isDecreasing","internal.asMonotonic","internal.asIncreasing","internal.asDecreasing","internal.antiderivative","internal.domain","internal.range","internal.unitRange","internal.length","internal.curvature"],"sources":["../../src/polynomial/linear.ts","../../src/polynomial/quadratic.ts"],"sourcesContent":["import type { Closed, Interval } from '../interval/interval.ts'\nimport type { Pipeable } from '../utils.ts'\nimport type * as Solution from '../solution/solution.ts'\nimport type { Vector2 } from '../vector/vector2.ts'\nimport type { LinearPolynomialTypeId } from './linear.internal.ts'\nimport * as internal from './linear.internal.ts'\nimport type { GuaranteedMonotonicity } from '../monotonicity/monotonicity.ts'\nimport type { QuadraticPolynomial } from './quadratic.ts'\nimport type { Decreasing, Increasing, Monotonic, PolynomialTraits } from './traits.ts'\n\nexport type { Monotonic, Increasing, Decreasing } from './traits.ts'\n\n/**\n * A linear polynomial.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * The `Traits` type parameter is a phantom marker that accumulates trait\n * brands as the polynomial is refined via `isMonotonic` / `asMonotonic` and\n * friends. The runtime value carries no trait data — `Traits` only flows\n * through the type system to enable tighter return types on operations like\n * `solveInverse`.\n *\n * @since 1.0.0\n */\nexport interface LinearPolynomial<out Traits = unknown> extends Pipeable {\n  readonly [LinearPolynomialTypeId]: LinearPolynomialTypeId\n  readonly [PolynomialTraits]: Traits\n\n  /**\n   * The coefficient of the x^0 term.\n   */\n  readonly c0: number\n\n  /**\n   * The coefficient of the x^1 term.\n   */\n  readonly c1: number\n}\n\n/**\n * Checks if a value is a `LinearPolynomial`.\n *\n * @param v - The value to check.\n * @returns `true` if the value is a `LinearPolynomial`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isLinearPolynomial: (v: unknown) => v is LinearPolynomial = internal.isLinearPolynomial\n\nexport const equals: {\n  /**\n   * Checks if two `LinearPolynomial` instances are approximately equal within\n   * the default absolute tolerance ({@link EPSILON}).\n   *\n   * @param a - The first polynomial.\n   * @param b - The second polynomial.\n   * @returns `true` when each pair of coefficients is within tolerance.\n   * @since 1.1.0\n   */\n  (a: LinearPolynomial, b: LinearPolynomial): boolean\n  /**\n   * Checks if two `LinearPolynomial` instances are approximately equal within\n   * the default absolute tolerance ({@link EPSILON}).\n   *\n   * @param b - The second polynomial.\n   * @returns A function that takes the first polynomial and returns the comparison result.\n   * @since 1.1.0\n   */\n  (b: LinearPolynomial): (a: LinearPolynomial) => boolean\n} = internal.equals\n\n/**\n * Creates a new `LinearPolynomial` instance.\n *\n * @param c0 - The coefficient of the x^0 term. Defaults to 0.\n * @param c1 - The coefficient of the x^1 term. Defaults to 0.\n * @returns A new `LinearPolynomial` instance.\n * @since 1.0.0\n */\nexport const make: (c0?: number, c1?: number) => LinearPolynomial = internal.make\n\n/**\n * Creates a new `LinearPolynomial` instance from a vector.\n *\n * @param v - The vector to create the polynomial from.\n * @returns A new `LinearPolynomial` instance.\n * @since 1.0.0\n */\nexport const fromVector: (v: Vector2) => LinearPolynomial = internal.fromVector\n\n/**\n * Creates a new `LinearPolynomial` instance from a point and slope.\n *\n * @param p - The point on the line.\n * @param slope - The slope of the line.\n * @returns A new `LinearPolynomial` instance.\n * @since 1.0.0\n */\nexport const fromPointSlope: (p: Vector2, slope: number) => LinearPolynomial =\n  internal.fromPointSlope\n\n/**\n * Creates a new `LinearPolynomial` instance from two points.\n *\n * @param p1 - The first point.\n * @param p2 - The second point.\n * @returns A new `LinearPolynomial` instance.\n * @since 1.0.0\n */\nexport const fromPoints: (p1: Vector2, p2: Vector2) => LinearPolynomial = internal.fromPoints\n\nexport const solve: {\n  /**\n   * Solves a linear polynomial for a given value of x.\n   *\n   * @param p - The linear polynomial to solve.\n   * @param x - The value of x to solve for.\n   * @returns The result of the polynomial evaluated at x.\n   * @since 1.0.0\n   */\n  (p: LinearPolynomial, x: number): number\n  /**\n   * Solves a linear polynomial for a given value of x.\n   *\n   * @param x - The value of x to solve for.\n   * @returns A function that takes a `LinearPolynomial` and returns the result of the polynomial evaluated at x.\n   * @since 1.0.0\n   */\n  (x: number): (p: LinearPolynomial) => number\n} = internal.solve\n\n/**\n * Converts a linear polynomial to a solver function.\n *\n * @param p - The linear polynomial to convert.\n * @returns A function that takes a value of x and returns the result of the polynomial evaluated at x.\n * @since 1.0.0\n */\nexport const toSolver: (p: LinearPolynomial) => (x: number) => number = internal.toSolver\n\n// The implementation always runs the same `c1 === 0 ? Solution.none : ...`\n// branch. For `Monotonic`-branded polynomials the empty branch is provably\n// unreachable, but TS can't see that — the cast pairs the type-level promise\n// with the runtime brand check.\nexport const solveInverse: {\n  /**\n   * Solves a monotonic linear polynomial for a given value of y. Because the\n   * polynomial is strictly monotonic, the inverse always has exactly one\n   * solution — wrapped in `Solution.One`.\n   *\n   * @param p - The monotonic linear polynomial to solve.\n   * @param y - The value of y to solve for.\n   * @since 2.0.0\n   */\n  <T extends Monotonic>(p: LinearPolynomial<T>, y: number): Solution.One<number>\n  /**\n   * Solves a linear polynomial for a given value of y. Returns `Solution.none`\n   * for constant polynomials (no inverse).\n   *\n   * @param p - The linear polynomial to solve.\n   * @param y - The value of y to solve for.\n   * @since 1.0.0\n   */\n  <T>(p: LinearPolynomial<T>, y: number): Solution.AtMostOne<number>\n  /** @since 1.0.0 */\n  (y: number): {\n    <T extends Monotonic>(p: LinearPolynomial<T>): Solution.One<number>\n    <T>(p: LinearPolynomial<T>): Solution.AtMostOne<number>\n  }\n} = internal.solveInverse as never\n\n/**\n * Converts a linear polynomial to an inverse solver function.\n *\n * @param p - The linear polynomial to convert.\n * @since 1.0.0\n */\nexport const toInverseSolver: (p: LinearPolynomial) => (y: number) => Solution.AtMostOne<number> =\n  internal.toInverseSolver\n\n/**\n * Finds the roots of a linear polynomial.\n *\n * @param p - The linear polynomial to find the roots of.\n * @since 1.0.0\n */\nexport const root: (p: LinearPolynomial) => Solution.AtMostOne<number> = (p) =>\n  internal.solveInverse(p, 0)\n\n/**\n * Calculates the monotonicity of a linear polynomial.\n *\n * @param p - The linear polynomial to check.\n * @returns The guaranteed monotonicity of the polynomial.\n * @since 1.0.0\n */\nexport const monotonicity: (p: LinearPolynomial) => GuaranteedMonotonicity = internal.monotonicity\n\n/**\n * Type-narrowing predicate: refines a `LinearPolynomial<T>` to\n * `LinearPolynomial<T & Monotonic>` when the polynomial is strictly monotonic.\n *\n * @param p - The linear polynomial to check.\n * @returns `true` when `monotonicity(p)` is `Increasing` or `Decreasing`.\n * @since 2.0.0\n */\nexport const isMonotonic: <T>(p: LinearPolynomial<T>) => p is LinearPolynomial<T & Monotonic> =\n  internal.isMonotonic\n\n/**\n * Type-narrowing predicate: refines to `LinearPolynomial<T & Increasing>`.\n *\n * @param p - The linear polynomial to check.\n * @returns `true` when `monotonicity(p)` is `Increasing`.\n * @since 2.0.0\n */\nexport const isIncreasing: <T>(p: LinearPolynomial<T>) => p is LinearPolynomial<T & Increasing> =\n  internal.isIncreasing\n\n/**\n * Type-narrowing predicate: refines to `LinearPolynomial<T & Decreasing>`.\n *\n * @param p - The linear polynomial to check.\n * @returns `true` when `monotonicity(p)` is `Decreasing`.\n * @since 2.0.0\n */\nexport const isDecreasing: <T>(p: LinearPolynomial<T>) => p is LinearPolynomial<T & Decreasing> =\n  internal.isDecreasing\n\n/**\n * Asserts that the linear polynomial is monotonic, throwing on failure.\n *\n * @param p - The linear polynomial to assert against.\n * @returns The same polynomial, typed with the `Monotonic` brand.\n * @throws When `monotonicity(p)` is `Constant`.\n * @since 2.0.0\n */\nexport const asMonotonic: <T>(p: LinearPolynomial<T>) => LinearPolynomial<T & Monotonic> =\n  internal.asMonotonic\n\n/**\n * Asserts that the linear polynomial is increasing, throwing on failure.\n *\n * @param p - The linear polynomial to assert against.\n * @returns The same polynomial, typed with the `Increasing` brand.\n * @throws When `monotonicity(p)` is not `Increasing`.\n * @since 2.0.0\n */\nexport const asIncreasing: <T>(p: LinearPolynomial<T>) => LinearPolynomial<T & Increasing> =\n  internal.asIncreasing\n\n/**\n * Asserts that the linear polynomial is decreasing, throwing on failure.\n *\n * @param p - The linear polynomial to assert against.\n * @returns The same polynomial, typed with the `Decreasing` brand.\n * @throws When `monotonicity(p)` is not `Decreasing`.\n * @since 2.0.0\n */\nexport const asDecreasing: <T>(p: LinearPolynomial<T>) => LinearPolynomial<T & Decreasing> =\n  internal.asDecreasing\n\n/**\n * Returns the polynomial's coefficients as a tuple `[c0, c1]`.\n *\n * @param p - The linear polynomial.\n * @returns The coefficients in monomial order.\n * @since 2.0.0\n */\nexport const coefficients: (p: LinearPolynomial) => readonly [number, number] =\n  internal.coefficients\n\n/**\n * Calculates the derivative of a linear polynomial.\n *\n * @param p - The linear polynomial to differentiate.\n * @returns The derivative of the linear polynomial.\n * @since 1.0.0\n */\nexport const derivative: (p: LinearPolynomial) => number = internal.derivative\n\nexport const antiderivative: {\n  /**\n   * Calculates the antiderivative of a linear polynomial.\n   *\n   * @param p - The linear polynomial to integrate.\n   * @param constant - The constant of integration. Defaults to 0.\n   * @returns The antiderivative of the linear polynomial.\n   * @since 1.0.0\n   */\n  (p: LinearPolynomial, constant?: number): QuadraticPolynomial\n  /**\n   * Calculates the antiderivative of a linear polynomial.\n   *\n   * @param constant - The constant of integration. Defaults to 0.\n   * @returns A function that takes a `LinearPolynomial` and returns the antiderivative of the polynomial.\n   * @since 1.0.0\n   */\n  (constant: number): (p: LinearPolynomial) => QuadraticPolynomial\n} = internal.antiderivative\n\nexport const domain: {\n  /**\n   * Calculates the domain of a linear polynomial.\n   *\n   * @param p - The linear polynomial to check.\n   * @param range - The range to check against.\n   * @returns The domain of the polynomial within the given range.\n   * @since 1.0.0\n   */\n  (p: LinearPolynomial, range: Interval): Solution.AtMostOne<Interval>\n  /**\n   * Calculates the domain of a linear polynomial.\n   *\n   * @param range - The range to check against.\n   * @returns A function that takes a `LinearPolynomial` and returns the domain of the polynomial within the given range.\n   * @since 1.0.0\n   */\n  (range: Interval): (p: LinearPolynomial) => Solution.AtMostOne<Interval>\n} = internal.domain\n\nexport const range: {\n  /**\n   * Calculates the range of a linear polynomial.\n   *\n   * @param p - The linear polynomial to check.\n   * @param domain - The domain to check against.\n   * @returns The range of the polynomial within the given domain.\n   * @since 1.0.0\n   */\n  (p: LinearPolynomial, domain: Interval): Closed\n  /**\n   * Calculates the range of a linear polynomial.\n   *\n   * @param domain - The domain to check against.\n   * @returns A function that takes a `LinearPolynomial` and returns the range of the polynomial within the given domain.\n   * @since 1.0.0\n   */\n  (domain: Interval): (p: LinearPolynomial) => Closed\n} = internal.range\n\n/**\n * Calculates the range of a linear polynomial over the unit interval `[0, 1]`.\n * Equivalent to `range(p, Interval.unit)` but without the import and call\n * overhead — directly evaluates the endpoints.\n *\n * @param p - The linear polynomial.\n * @returns The closed range of the polynomial over `[0, 1]`.\n * @since 2.0.0\n */\nexport const unitRange: (p: LinearPolynomial) => Closed = internal.unitRange\n\nexport const length: {\n  /**\n   * Calculates the length of a linear polynomial within a particular domain `Interval`.\n   *\n   * @param p - The linear polynomial to analyze.\n   * @param domain - The domain to restrict the analysis to.\n   * @returns The length of the linear polynomial in the specified domain.\n   * @since 1.0.0\n   */\n  (p: LinearPolynomial, domain: Interval): number\n  /**\n   * Calculates the length of a linear polynomial within a particular domain `Interval`.\n   *\n   * @param domain - The domain to restrict the analysis to.\n   * @returns A function that takes a `LinearPolynomial` and returns the length of the polynomial in the specified domain.\n   * @since 1.0.0\n   */\n  (domain: Interval): (p: LinearPolynomial) => number\n} = internal.length\n","import type { Closed, Interval } from '../interval/interval.ts'\nimport type { Pipeable } from '../utils.ts'\nimport type * as Solution from '../solution/solution.ts'\nimport type { Vector2 } from '../vector/vector2.ts'\nimport type { Vector3 } from '../vector/vector3.ts'\nimport type { CubicPolynomial } from './cubic.ts'\nimport type { LinearPolynomial } from './linear.ts'\nimport type { Monotonicity } from '../monotonicity/monotonicity.ts'\nimport * as internal from './quadratic.internal.ts'\nimport type { QuadraticPolynomialTypeId } from './quadratic.internal.circular.ts'\nimport type { Decreasing, Increasing, Monotonic, PolynomialTraits } from './traits.ts'\n\nexport type { Monotonic, Increasing, Decreasing } from './traits.ts'\n\n/**\n * A quadratic polynomial.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * The `Traits` type parameter is a phantom marker that accumulates trait\n * brands as the polynomial is refined via `isMonotonic` / `asMonotonic` and\n * friends. Refinements may be parameterized by an `Interval` — a quadratic is\n * monotonic on an interval that avoids its extremum, even though it is not\n * monotonic globally.\n *\n * @since 1.0.0\n */\nexport interface QuadraticPolynomial<out Traits = unknown> extends Pipeable {\n  readonly [QuadraticPolynomialTypeId]: QuadraticPolynomialTypeId\n  readonly [PolynomialTraits]: Traits\n\n  /**\n   * The coefficient of the x^0 term.\n   */\n  readonly c0: number\n  /**\n   * The coefficient of the x^1 term.\n   */\n  readonly c1: number\n  /**\n   * The coefficient of the x^2 term.\n   */\n  readonly c2: number\n}\n\n/**\n * Checks if a value is a `QuadraticPolynomial`.\n *\n * @param v - The value to check.\n * @returns `true` if the value is a `QuadraticPolynomial`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isQuadraticPolynomial: (v: unknown) => v is QuadraticPolynomial =\n  internal.isQuadraticPolynomial\n\nexport const equals: {\n  /**\n   * Checks if two `QuadraticPolynomial` instances are approximately equal\n   * within the default absolute tolerance ({@link EPSILON}).\n   *\n   * @param a - The first polynomial.\n   * @param b - The second polynomial.\n   * @returns `true` when each pair of coefficients is within tolerance.\n   * @since 1.1.0\n   */\n  (a: QuadraticPolynomial, b: QuadraticPolynomial): boolean\n  /**\n   * Checks if two `QuadraticPolynomial` instances are approximately equal\n   * within the default absolute tolerance ({@link EPSILON}).\n   *\n   * @param b - The second polynomial.\n   * @returns A function that takes the first polynomial and returns the comparison result.\n   * @since 1.1.0\n   */\n  (b: QuadraticPolynomial): (a: QuadraticPolynomial) => boolean\n} = internal.equals\n\n/**\n * Creates a new `QuadraticPolynomial` instance.\n *\n * @param c0 - The coefficient of the x^0 term. Defaults to 0.\n * @param c1 - The coefficient of the x^1 term. Defaults to 0.\n * @param c2 - The coefficient of the x^2 term. Defaults to 1.\n * @returns A new `QuadraticPolynomial` instance.\n * @since 1.0.0\n */\nexport const make: (c0?: number, c1?: number, c2?: number) => QuadraticPolynomial = internal.make\n\n/**\n * Creates a new `QuadraticPolynomial` instance from a vector.\n *\n * @param v - The vector to create the polynomial from.\n * @returns A new `QuadraticPolynomial` instance.\n * @since 1.0.0\n */\nexport const fromVector: (v: Vector3) => QuadraticPolynomial = internal.fromVector\n\n/**\n * Creates a new `QuadraticPolynomial` that interpolates the three given\n * points, treating each `Vector2` as an `(x, y)` pair. The three input `x`\n * values must be distinct.\n *\n * @param p0 - The first point.\n * @param p1 - The second point.\n * @param p2 - The third point.\n * @returns The unique quadratic polynomial passing through the three points.\n * @since 2.0.0\n */\nexport const fromPoints: (p0: Vector2, p1: Vector2, p2: Vector2) => QuadraticPolynomial =\n  internal.fromPoints\n\nexport const solve: {\n  /**\n   * Solves the quadratic polynomial for a given x value.\n   *\n   * @param p - The quadratic polynomial.\n   * @param x - The x value to solve for.\n   * @returns The result of the polynomial at the given x value.\n   * @since 1.0.0\n   */\n  (p: QuadraticPolynomial, x: number): number\n  /**\n   * Solves the quadratic polynomial for a given x value.\n   *\n   * @param x - The x value to solve for.\n   * @returns A function that takes a quadratic polynomial and returns the result of the polynomial at the given x value.\n   * @since 1.0.0\n   */\n  (x: number): (p: QuadraticPolynomial) => number\n} = internal.solve\n\n/**\n * Creates a solver function for the quadratic polynomial.\n *\n * @param p - The quadratic polynomial.\n * @returns A function that takes an x value and returns the result of the polynomial at that x value.\n */\nexport const toSolver: (p: QuadraticPolynomial) => (x: number) => number = internal.toSolver\n\nexport const solveInverse: {\n  /**\n   * Solves a monotonic quadratic polynomial for a given y value. Because the\n   * polynomial is strictly monotonic (either globally, or over the interval\n   * the `Monotonic` brand was attached for), the inverse has at most one\n   * solution.\n   *\n   * @param p - The monotonic quadratic polynomial.\n   * @param y - The y value to solve for.\n   * @returns Zero or one solutions.\n   * @since 2.0.0\n   */\n  <T extends Monotonic>(p: QuadraticPolynomial<T>, y: number): Solution.AtMostOne<number>\n  /**\n   * Solves the quadratic polynomial for a given y value.\n   *\n   * @param p - The quadratic polynomial.\n   * @param y - The y value to solve for.\n   * @returns The solutions to the polynomial at the given y value.\n   * @since 1.0.0\n   */\n  <T>(p: QuadraticPolynomial<T>, y: number): Solution.AtMostTwo<number>\n  /**\n   * Solves the quadratic polynomial for a given y value.\n   *\n   * @param y - The y value to solve for.\n   * @returns A function that takes a quadratic polynomial and returns the\n   *   solutions. Tightens to `Solution.AtMostOne<number>` for monotonic inputs.\n   * @since 1.0.0\n   */\n  (y: number): {\n    <T extends Monotonic>(p: QuadraticPolynomial<T>): Solution.AtMostOne<number>\n    <T>(p: QuadraticPolynomial<T>): Solution.AtMostTwo<number>\n  }\n} = internal.solveInverse as never\n\n/**\n * Creates an inverse solver function for the quadratic polynomial.\n *\n * @param p - The quadratic polynomial.\n * @returns A function that takes a y value and returns the solutions to the polynomial at that y value.\n */\nexport const toInverseSolver: (\n  p: QuadraticPolynomial,\n) => (y: number) => Solution.AtMostTwo<number> = internal.toInverseSolver\n\n/**\n * Returns the polynomial's coefficients as a tuple `[c0, c1, c2]`.\n *\n * @param p - The quadratic polynomial.\n * @returns The coefficients in monomial order.\n * @since 2.0.0\n */\nexport const coefficients: (p: QuadraticPolynomial) => readonly [number, number, number] =\n  internal.coefficients\n\n/**\n * Computes the derivative of the quadratic polynomial.\n *\n * @param p - The quadratic polynomial.\n * @returns The derivative of the polynomial as a linear polynomial.\n * @since 1.0.0\n */\nexport const derivative: (p: QuadraticPolynomial) => LinearPolynomial = internal.derivative\n\n/**\n * Finds the roots of the quadratic polynomial.\n *\n * @param p - The quadratic polynomial.\n * @returns The roots of the polynomial as a tuple of solutions.\n * @since 1.0.0\n */\nexport const roots: (p: QuadraticPolynomial) => Solution.AtMostTwo<number> = internal.roots\n\n/**\n * Finds the extreme point of the quadratic polynomial.\n *\n * @param p - The quadratic polynomial.\n * @returns The extreme point of the polynomial as a solution.\n * @since 1.0.0\n */\nexport const extreme: (p: QuadraticPolynomial) => Vector2 | null = internal.extreme\n\nexport const monotonicity: {\n  /**\n   * Computes the monotonicity of the quadratic polynomial over a given\n   * interval. Throws when the interval has zero width — the question is\n   * undefined at a single point.\n   *\n   * @param p - The quadratic polynomial.\n   * @param i - The interval to compute the monotonicity over.\n   * @returns The monotonicity of the polynomial over the interval.\n   * @since 1.0.0\n   */\n  (p: QuadraticPolynomial, i?: Interval): Monotonicity\n  /**\n   * Computes the monotonicity of the quadratic polynomial over a given\n   * interval. Throws when the interval has zero width.\n   *\n   * @param i - The interval to compute the monotonicity over.\n   * @returns A function that takes a quadratic polynomial and returns the\n   *   monotonicity of the polynomial over the interval.\n   * @since 1.0.0\n   */\n  (i: Interval): (p: QuadraticPolynomial) => Monotonicity\n} = internal.monotonicity\n\n/**\n * Type-narrowing predicate: refines a `QuadraticPolynomial<T>` to\n * `QuadraticPolynomial<T & Monotonic>` when the polynomial is strictly\n * monotonic over the given interval (or globally, when no interval is given).\n *\n * @param p - The quadratic polynomial to check.\n * @param i - Optional interval over which to check monotonicity.\n * @returns `true` when monotonicity is `Increasing` or `Decreasing`.\n * @since 2.0.0\n */\nexport const isMonotonic: {\n  <T>(p: QuadraticPolynomial<T>, i?: Interval): p is QuadraticPolynomial<T & Monotonic>\n  (i: Interval): <T>(p: QuadraticPolynomial<T>) => p is QuadraticPolynomial<T & Monotonic>\n} = internal.isMonotonic\n\n/**\n * Type-narrowing predicate: refines to `QuadraticPolynomial<T & Increasing>`.\n *\n * @since 2.0.0\n */\nexport const isIncreasing: {\n  <T>(p: QuadraticPolynomial<T>, i?: Interval): p is QuadraticPolynomial<T & Increasing>\n  (i: Interval): <T>(p: QuadraticPolynomial<T>) => p is QuadraticPolynomial<T & Increasing>\n} = internal.isIncreasing\n\n/**\n * Type-narrowing predicate: refines to `QuadraticPolynomial<T & Decreasing>`.\n *\n * @since 2.0.0\n */\nexport const isDecreasing: {\n  <T>(p: QuadraticPolynomial<T>, i?: Interval): p is QuadraticPolynomial<T & Decreasing>\n  (i: Interval): <T>(p: QuadraticPolynomial<T>) => p is QuadraticPolynomial<T & Decreasing>\n} = internal.isDecreasing\n\n/**\n * Asserts that the quadratic polynomial is monotonic, throwing on failure.\n *\n * @param p - The quadratic polynomial to assert against.\n * @param i - Optional interval over which to check monotonicity.\n * @returns The same polynomial, typed with the `Monotonic` brand.\n * @throws When the polynomial is not monotonic over the given (or global) interval.\n * @since 2.0.0\n */\nexport const asMonotonic: <T>(\n  p: QuadraticPolynomial<T>,\n  i?: Interval,\n) => QuadraticPolynomial<T & Monotonic> = internal.asMonotonic\n\n/**\n * Asserts that the quadratic polynomial is increasing, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asIncreasing: <T>(\n  p: QuadraticPolynomial<T>,\n  i?: Interval,\n) => QuadraticPolynomial<T & Increasing> = internal.asIncreasing\n\n/**\n * Asserts that the quadratic polynomial is decreasing, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asDecreasing: <T>(\n  p: QuadraticPolynomial<T>,\n  i?: Interval,\n) => QuadraticPolynomial<T & Decreasing> = internal.asDecreasing\n\nexport const antiderivative: {\n  /**\n   * Computes the antiderivative of the quadratic polynomial.\n   *\n   * @param p - The quadratic polynomial.\n   * @param constant - The constant of integration. Defaults to 0.\n   * @returns The antiderivative of the polynomial as a cubic polynomial.\n   * @since 1.0.0\n   */\n  (p: QuadraticPolynomial, constant?: number): CubicPolynomial\n  /**\n   * Computes the antiderivative of the quadratic polynomial.\n   *\n   * @param constant - The constant of integration. Defaults to 0.\n   * @returns A function that takes a quadratic polynomial and returns the antiderivative of the polynomial as a cubic polynomial.\n   * @since 1.0.0\n   */\n  (constant: number): (p: QuadraticPolynomial) => CubicPolynomial\n} = internal.antiderivative\n\nexport const domain: {\n  /**\n   * Computes the domain of the quadratic polynomial over a given range.\n   *\n   * @param p - The quadratic polynomial.\n   * @param range - The range to compute the domain over.\n   * @returns The domain of the polynomial over the range.\n   * @since 1.0.0\n   */\n  (p: QuadraticPolynomial, range: Interval): Solution.AtMostOne<Interval>\n  /**\n   * Computes the domain of the quadratic polynomial over a given range.\n   *\n   * @param range - The range to compute the domain over.\n   * @returns A function that takes a quadratic polynomial and returns the domain of the polynomial over the range.\n   * @since 1.0.0\n   */\n  (range: Interval): (p: QuadraticPolynomial) => Solution.AtMostOne<Interval>\n} = internal.domain\n\nexport const range: {\n  /**\n   * Computes the range of the quadratic polynomial over a given domain.\n   *\n   * @param p - The quadratic polynomial.\n   * @param domain - The domain to compute the range over.\n   * @returns The range of the polynomial over the domain.\n   * @since 1.0.0\n   */\n  (p: QuadraticPolynomial, domain: Interval): Closed\n  /**\n   * Computes the range of the quadratic polynomial over a given domain.\n   *\n   * @param domain - The domain to compute the range over.\n   * @returns A function that takes a quadratic polynomial and returns the range of the polynomial over the domain.\n   * @since 1.0.0\n   */\n  (domain: Interval): (p: QuadraticPolynomial) => Closed\n} = internal.range\n\n/**\n * Computes the range of the quadratic polynomial over the unit interval\n * `[0, 1]`. Equivalent to `range(p, Interval.unit)` — accounts for any\n * interior extremum in `[0, 1]`.\n *\n * @param p - The quadratic polynomial.\n * @returns The closed range of the polynomial over `[0, 1]`.\n * @since 2.0.0\n */\nexport const unitRange: (p: QuadraticPolynomial) => Closed = internal.unitRange\n\nexport const length: {\n  /**\n   * Computes the length of the quadratic polynomial over a given interval.\n   *\n   * @param p - The quadratic polynomial.\n   * @param i - The interval to compute the length over.\n   * @returns The length of the polynomial over the interval.\n   * @since 1.0.0\n   */\n  (p: QuadraticPolynomial, i: Interval): number\n  /**\n   * Computes the length of the quadratic polynomial over a given interval.\n   *\n   * @param i - The interval to compute the length over.\n   * @returns A function that takes a quadratic polynomial and returns the length of the polynomial over the interval.\n   * @since 1.0.0\n   */\n  (i: Interval): (p: QuadraticPolynomial) => number\n} = internal.length\n\nexport const curvature: {\n  /**\n   * Computes the curvature of the quadratic polynomial at a given x value.\n   *\n   * @param p - The quadratic polynomial.\n   * @param x - The x value to compute the curvature at.\n   * @returns The curvature of the polynomial at the given x value.\n   * @since 1.0.0\n   */\n  (p: QuadraticPolynomial, x: number): number\n  /**\n   * Computes the curvature of the quadratic polynomial at a given x value.\n   *\n   * @param x - The x value to compute the curvature at.\n   * @returns A function that takes a quadratic polynomial and returns the curvature of the polynomial at the given x value.\n   * @since 1.0.0\n   */\n  (x: number): (p: QuadraticPolynomial) => number\n} = internal.curvature\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAa,qBAA4DA;AAEzE,MAAaC,WAoBTC;;;;;;;;;AAUJ,MAAaC,SAAuDC;;;;;;;;AASpE,MAAaC,eAA+CC;;;;;;;;;AAU5D,MAAa,iBACXC;;;;;;;;;AAUF,MAAaC,eAA6DC;AAE1E,MAAaC,UAkBTC;;;;;;;;AASJ,MAAaC,aAA2DC;AAMxE,MAAaC,iBAyBTC;;;;;;;AAQJ,MAAaC,oBACXC;;;;;;;AAQF,MAAa,QAA6D,MACxEF,eAAsB,GAAG,EAAE;;;;;;;;AAS7B,MAAaG,iBAAgEC;;;;;;;;;AAU7E,MAAaC,gBACXC;;;;;;;;AASF,MAAaC,iBACXC;;;;;;;;AASF,MAAaC,iBACXC;;;;;;;;;AAUF,MAAaC,gBACXC;;;;;;;;;AAUF,MAAaC,iBACXC;;;;;;;;;AAUF,MAAaC,iBACXC;;;;;;;;AASF,MAAaC,iBACXC;;;;;;;;AASF,MAAaC,eAA8CC;AAE3D,MAAaC,mBAkBTC;AAEJ,MAAaC,WAkBTC;AAEJ,MAAaC,UAkBTC;;;;;;;;;;AAWJ,MAAaC,cAA6CC;AAE1D,MAAaC,WAkBTC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9TJ,MAAa,wBACXC;AAEF,MAAa,SAoBTC;;;;;;;;;;AAWJ,MAAa,OAAuEC;;;;;;;;AASpF,MAAa,aAAkDC;;;;;;;;;;;;AAa/D,MAAa,aACXC;AAEF,MAAa,QAkBTC;;;;;;;AAQJ,MAAa,WAA8DC;AAE3E,MAAa,eAkCTC;;;;;;;AAQJ,MAAa,kBAEoCC;;;;;;;;AASjD,MAAa,eACXC;;;;;;;;AASF,MAAa,aAA2DC;;;;;;;;AASxE,MAAa,QAAgEC;;;;;;;;AAS7E,MAAa,UAAsDC;AAEnE,MAAa,eAsBTC;;;;;;;;;;;AAYJ,MAAa,cAGTC;;;;;;AAOJ,MAAa,eAGTC;;;;;;AAOJ,MAAa,eAGTC;;;;;;;;;;AAWJ,MAAa,cAG6BC;;;;;;AAO1C,MAAa,eAG8BC;;;;;;AAO3C,MAAa,eAG8BC;AAE3C,MAAa,iBAkBTC;AAEJ,MAAa,SAkBTC;AAEJ,MAAa,QAkBTC;;;;;;;;;;AAWJ,MAAa,YAAgDC;AAE7D,MAAa,SAkBTC;AAEJ,MAAa,YAkBTC"}