/** * chebyshev.ts * * Chebyshev polynomial evaluation using the Clenshaw recurrence. * Used to evaluate SPK Type 2 ephemeris records. * * All positions are in km (barycentric J2000 equatorial rectangular). * Velocities are in km/s. */ /** * Evaluate a Chebyshev series at normalised argument τ ∈ [-1, +1]. * * Uses the Clenshaw recurrence (numerically stable, O(n)): * b_{n+1} = 0 * b_k = 2τ·b_{k+1} − b_{k+2} + aₖ * result = τ·b₁ − b₂ + a₀ */ export declare function evalCheby(coeffs: readonly number[], tau: number): number; /** * Evaluate the derivative dF/dτ of a Chebyshev series. * * Uses the paired forward recurrences for the polynomials and their derivatives: * T₀ = 1, T₁ = τ, Tₖ = 2τ·Tₖ₋₁ − Tₖ₋₂ * T′₀ = 0, T′₁ = 1, T′ₖ = 2·Tₖ₋₁ + 2τ·T′ₖ₋₁ − T′ₖ₋₂ * * The previous implementation folded a `2k` weight into a Clenshaw-style loop * and closed with an unjustified factor of ½. It returned roughly 0.35× the * true derivative — Earth's barycentric speed came out as 10.7 km/s instead of * 30.2 km/s — which corrupted stellar aberration and every planet's daily * motion (and therefore retrograde detection). * * Records hold ~10–15 coefficients, so the explicit recurrence costs nothing * measurable and is far easier to verify than a folded form. * * To convert to physical velocity: vel = dF/dτ ÷ RADIUS, with RADIUS in seconds. */ export declare function evalChebyDeriv(coeffs: readonly number[], tau: number): number; export interface Vec3 { /** km */ x: number; /** km */ y: number; /** km */ z: number; /** km/s */ vx: number; /** km/s */ vy: number; /** km/s */ vz: number; } /** * Evaluate an SPK Type 2 coefficient record at ephemeris time `et`. * * @param record Flat array of doubles from the SPK data: * [MID, RADIUS, x₀…xₙ, y₀…yₙ, z₀…zₙ] * @param et Ephemeris time (seconds from J2000.0 TDB) */ export declare function evalRecord(record: Float64Array | number[], et: number): Vec3;