UNPKG

@thi.ng/geom-splines

Version:

nD cubic & quadratic curve analysis, conversion, interpolation, splitting

28 lines 983 B
import type { FnU3 } from "@thi.ng/api"; import type { ReadonlyVec, Vec } from "@thi.ng/vectors"; /** * Converts the quadratic curve defined by given control points into a cubic * bezier. Returns array of 4 new control points. * * @param a * @param b * @param c */ export declare const cubicFromQuadratic: FnU3<ReadonlyVec, Vec[]>; /** * Splits given cubic curve (defined by given control points) into 2 quadratic * curve segments approximating the original curve. The `gamma` param (in * `[0,1]` interval) can be used to control the split point (default: 0.5). * Returns array of new curves (each a 3-tuple of control points). * * @remarks * Reference: https://ttnghia.github.io/pdf/QuadraticApproximation.pdf * * @param a * @param b * @param c * @param d * @param gamma */ export declare const quadraticFromCubic: (a: ReadonlyVec, b: ReadonlyVec, c: ReadonlyVec, d: ReadonlyVec, gamma?: number) => Vec<number>[][]; //# sourceMappingURL=cubic-quadratic.d.ts.map