Function lupnt::cheby_eval

Function Documentation

void lupnt::cheby_eval(double x, double *scale, double *coeff, long num, double *f, double *df)

Evaluate a Chebyshev polynomial (and its derivative) at x, double-precision implementation.

Evaluates the degree-(num-1) Chebyshev series with coefficients coeff[0..num-1] (T_n basis, constant term first), after rescaling x to [-1, 1] via the segment’s midpoint/radius scale = {scale[0], / scale[1]} (valid for x in [scale[0]-scale[1], scale[0]+scale[1]]). Used internally by cheby_posvel to evaluate one (x, y, or z) component of an SPK Chebyshev record.

Parameters:
  • x – Evaluation point (e.g. ephemeris time [s past J2000])

  • scale{midpoint, radius} of the valid interval for x

  • coeff – Chebyshev coefficients, constant term first, length num

  • num – Number of coefficients (polynomial degree + 1)

  • f – Output: polynomial value at x

  • df – Output: derivative of the polynomial at x w.r.t. x