UNPKG

frame.akima

Version:

A package for Akima interpolation

74 lines 2.01 kB
export declare function getCenter(points: { x: number; y: number; }[]): { x: number; y: number; }; export declare function sortPointsCounterClockwise(points: { x: number; y: number; }[]): { x: number; y: number; }[]; export declare function createCatmullRomSpline(points: { x: number; y: number; }[]): (angle: number) => { x: number; y: number; radius: number; }; /** * Baut aus einer Punktwolke einen geschlossenen Catmull-Rom-Spline in Polarkoordinaten * und liefert eine Funktion sample(angle) => [x, y]. * * @param points Array von {x, y} – idealerweise rundum verteilt, ein geschlossener Umriss. * @returns Funktion, die für angle in [0, 2π) den interpolierten Punkt zurückgibt. */ export declare function createPolarCatmullRom(points: { x: number; y: number; }[]): (angle: number) => { x: number; y: number; radius: number; }; /** * Catmull-Rom Spline class for creating equidistant points */ export declare class Catmull { private splineFunc; private center; constructor(points: { x: number; y: number; }[]); /** * Returns an array of 128 points with equidistant angles from the center * @returns Array of 128 points with angles evenly distributed from 0 to 2π */ getEquidistantAnglePoints(): { x: number; y: number; radius: number; }[]; /** * Returns an array of 128 points with equidistant radii from the center * @returns Array of 128 points with consistent radius distribution */ getEquidistantRadiusPoints(): { x: number; y: number; radius: number; }[]; /** * Binary search to find the angle that produces the closest radius to target * @param targetRadius The desired radius * @param initialAngle Starting angle for search * @returns Point with radius closest to target */ private findAngleForRadius; } //# sourceMappingURL=CatmullRom.d.ts.map