#ifndef HINTERPOLATE_H #define HINTERPOLATE_H /********************************************************************************* * * Purpose: interpolate interpolates for the position and velocity components * at a specific time within time ordered arrays of position and * velocity data. A hermite polynomial, which considers both * position and velocity components, is used for the interpolation. * * Input: posArray 2D Array of Position Components * velArray 2D Array of Velocity Components * xn Starting Point Index for Interpolation * cnum Number of Coordinates Being Interpolated * asize Number of Elements in Array[cnum][asize] * tstep Time Difference between Points in Array * intpts Number of Interpolation Points * tdif Time Difference xn - xi = tdif * Output: newPos Interpolated Position Vector for time xi * newVel Interpolated Velocity Vector for time xi * * Converted from FORTRAN INTRP0 (J.Toth) on 10/21/2002 by C.W.Brown * **********************************************************************************/ #include "Ephemeris.h" #define MAX_INTPTS 15 #define MAX_ARR_SIZE 2000 //void interpolate(double posArray[][MAX_ARR_SIZE], double velArray[][MAX_ARR_SIZE], void interpolate(double *posArray, double *velArray, int xn, int cnum, int asize, double tstep, int intpts, double tdif, double newPos[], double newVel[]); void compute_hermi(int a, double v, double w, double x, double y, double z, double xArr[2][MAX_INTPTS], double yArr[2][MAX_INTPTS]); void calculate_hc(double &w, double &x, double &y, double z, int a, int b); void initialize_hc(int &a, double &x, double &y, double &z); #endif