Skip to main content

Crate cheby

Crate cheby 

Source
Expand description

Chebyshev polynomial toolkit: node generation, coefficient fitting, and Clenshaw evaluation — generic over scalar type.

§Overview

This crate provides the full pipeline for piecewise Chebyshev interpolation, as used in JPL DE-series ephemerides and cached lunar/planetary position evaluators:

  1. nodes — Chebyshev node generation on [-1, 1] or mapped to an arbitrary interval.
  2. [fit] — DCT-based coefficient computation from function values at Chebyshev nodes.
  3. [eval] — Clenshaw-recurrence evaluation of a Chebyshev series (value, derivative, or both in one pass).
  4. segment — Piecewise Chebyshev approximation over uniform time segments, with automatic lookup and t → τ normalisation.

All core functions are generic over ChebyScalar, so they work with raw f64 as well as typed quantities (qtty::Quantity<U>).

Re-exports§

pub use scalar::ChebyScalar;
pub use segment::ChebySegment;
pub use segment::ChebySegmentTable;

Modules§

scalar
Scalar trait for Chebyshev operations.
segment
Piecewise Chebyshev segment management.

Functions§

evaluate
Evaluate a Chebyshev polynomial using the Clenshaw algorithm.
evaluate_both
Evaluate both the Chebyshev polynomial and its derivative in one pass.
evaluate_derivative
Evaluate the derivative of a Chebyshev polynomial.
fit_coeffs
Compute Chebyshev coefficients from function values at the canonical Chebyshev nodes.
fit_from_fn
Sample a function at N Chebyshev nodes on [start, end] and fit Chebyshev coefficients.
nodes
Compute N Chebyshev nodes on [-1, 1].
nodes_mapped
Compute N Chebyshev nodes mapped to the interval [start, end].