Function lupnt::cheby_eval

Function Documentation

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

Evaluate the given Chebyshev polynomial at x, returning both the evaluated polynomial in *f, and the evaluated derivative of the polymonial in df. The number of coefficients is num (the degree of the polynomial is num - 1), and the coefficients are coeff[0..num-1]. The first coefficient coeff[0] is the constant term. The scaling of x is provided by the midpoint scale[0] and the radius scale[1]. x must fall in the range scale[0] - scale[1] to scale[0] + scale[1]. Outside of that range, the polynomial is not valid.

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