Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

core/planetsephems/calc_interpolated_elements.h

00001 /************************************************************************
00002 
00003 Copyright (c) 2007 Johannes Gajdosik
00004 
00005 Permission is hereby granted, free of charge, to any person obtaining a
00006 copy of this software and associated documentation files (the "Software"),
00007 to deal in the Software without restriction, including without limitation
00008 the rights to use, copy, modify, merge, publish, distribute, sublicense,
00009 and/or sell copies of the Software, and to permit persons to whom the
00010 Software is furnished to do so, subject to the following conditions:
00011 
00012 The above copyright notice and this permission notice shall be included
00013 in all copies or substantial portions of the Software.
00014 
00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00018 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00019 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00020 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00021 SOFTWARE.
00022 
00023 ****************************************************************/
00024 
00025 extern
00026 void CalcInterpolatedElements(double t,double elem[],
00027                               int dim,
00028                               void (*calc_func)(double t,double elem[]),
00029                               double delta_t,
00030                               double *t0,double e0[],
00031                               double *t1,double e1[],
00032                               double *t2,double e2[]);
00033 
00034 /*
00035 Simple interpolation routine with external cache.
00036 The cache consists of 3 sets of values:
00037   e0[0..dim-1] are the cached values at time *t0,
00038   e1[0..dim-1] are the cached values at time *t1,
00039   e2[0..dim-1] are the cached values at time *t2
00040 delta_t is the time step: *t2-*t1 = *t1-*t0 = delta_t,
00041 (*calc_func)(t,elem) calculates the values elem[0..dim-1] at time t,
00042 t is the input parameter, elem[0..dim-1] are the output values.
00043 
00044 The user must supply *t0,*t1,*t2,e0,e1,e2.
00045 The initial values must be *t0 = *t1 = *t2 = -1e100,
00046 the initial values of e0,e1,e2 can be undefined.
00047 The values of *t0,*t1,*t2,e0,e1,e2 belong to this function,
00048 the user must never change them.
00049 
00050 The user must always supply the same delta_t
00051 for one set of (*t0,*t1,*t2,e0,e1,e2),
00052 and of course the same dim and calc_func.
00053 */

Generated on Wed Jun 2 13:11:13 2010 for Stellarium by  doxygen 1.5.5