ocssw  1.0
/disk01/web/ocssw/build/src/geogen_modis/GEO_util.h (r8102/r7924)
Go to the documentation of this file.
00001 /*
00002 !C-INC*************************************************************************
00003 
00004 !Description:   the .h file for the utility functions in the Level-1A 
00005                 geolocation software
00006 
00007 !Input Parameters: N/A
00008 
00009 !Output Parameters: N/A
00010 
00011 !Revision History:
00012  * $Log: GEO_util.h,v $
00013  * Revision 6.1  2011/02/14 21:36:35  kuyper
00014  * Corrected const-qualification of arguments to GEO_poly_fit().
00015  *
00016  * Revision 5.1  2005/03/16 21:36:13  kuyper
00017  * Changed header guard macro name to avoid reserved name space.
00018  *
00019  * Revision 4.1  2002/12/05 19:26:59  kuyper
00020  * Dropped obsolete chebyshev polynomial functions.
00021  *
00022  * Revision 2.3  1999/03/12 17:48:37  kuyper
00023  * Capitalized Prolog Sections
00024  *
00025  * Revision 2.2  1997/10/24  13:25:20  kuyper
00026  * Removed GEO_lagrange() declaration.
00027  *
00028  * Revision 2.1  1997/10/21  18:15:47  kuyper
00029  * Returned from ClearCase
00030  *
00031  * Revision /main/GEO_V2_DEV/2 1997/09/19 kuyper
00032  * Added CUBIC macro.
00033  *
00034  * Revision /main/GEO_V2_DEV/1 1997/08/14 kuyper
00035  * Added declarations for Chebyshev functions and globals.
00036  *
00037  * Revision 1.4  1997/07/18  21:58:00  kuyper
00038  * Baselined Version 1
00039  *
00040  * Revision 1.4  1996/07/24  22:19:42  fhliang
00041  * Initial revision of SDST delivery of GEO_util.h.
00042  *
00043         Revision 1.3  1996/07/24 22:19:42  kuyper
00044         Inserted required '!'s in comments.
00045         Declared GEO_mat_vec_mul3, GEO_vec_prod3, GEO_vec_length3 as void.
00046         Declared arguments const.
00047 
00048         Revision 1.2  1996/07/18 22:07:16  kuyper
00049         Removed GEO_factorial() and GEO_combination() function declarations.
00050 
00051 
00052         4/5/95
00053         Ruiming Chen
00054         Finished coding
00055 
00056         6/20/95
00057         Frederick S. Patt (patt@modis-xl.gsfc.nasa.gov)
00058         Removed unused routines
00059 
00060 !Team-unique Header:
00061                 This software is developed by the MODIS Science Data Support
00062                 Team for the National Aeronautics and Space Administration,
00063                 Goddard Space Flight Center, under contract NAS5-32373.
00064 
00065 !END***************************************************************************
00066 */
00067 
00068 #ifndef GEO_UTIL_H
00069 #define GEO_UTIL_H
00070 /* Macros.  */
00071 #define CUBIC 4
00072 
00073 /* function prototypes */
00074 int GEO_vec_mul3(              /* cal. the cross product of two 3-dim vecs */
00075     double vec1[3],              /* input vec 1 */
00076     double vec2[3],              /* input vec 2 */
00077     double vec[3]            /* output vec */
00078         );
00079 
00080 void GEO_mat_vec_mul3(         /* cal. a vec of the mul. of a matrix and  vec */
00081     double  mat[3][3],           /* input 2-dim matrix */
00082     double  vec1[3],               /* input vec */
00083     double  vec[3]           /* output vec */
00084         );
00085 
00086 int GEO_mat_mul3(              /* cal. matrix of the mul. of 2 matrices */
00087     double  mat1[3][3],          /* input 2-dim matrix 1 */
00088     double  mat2[3][3],           /* input 2-dim matrix 2 */
00089     double  mat[3][3]        /* output 2-dim matrix */
00090         );
00091 
00092 void GEO_vec_prod3(         /* cal. the dot product of two vecs */
00093     double  vec1[3],        /* input vec 1 */
00094     double  vec2[3],        /* input vec 2 */
00095     double  * const prod    /* output vec */
00096     );
00097 
00098 void GEO_vec_length3(       /* length of vec with size 3*/
00099     double vec[3],          /* input vec */
00100     double * const length   /* output length */
00101     );
00102 
00103 int GEO_vec_unit3(          /* normalizes a vector */
00104     double vec[3],          /* input vec */
00105     double unit_vec[3]      /* output unit_vec */
00106     );
00107 
00108 int GEO_poly_coef1(         /* determine cubic polynomial coefficients */
00109     double const var_val1,  /* displacement at t1 */
00110     double const var_val2,  /* displacement at t2 */
00111     double const val_derv1, /* derivative at t1 */
00112     double const val_derv2, /* derivative at t1 */
00113     double const t1,        /* first time */ 
00114     double const t2,        /* second time */
00115     double coef[CUBIC]  /* cubic polynomial coefficients */
00116     );
00117 
00118 int GEO_poly_fit(                   /* evaluate polynomial */
00119     double const    *,      /* array of polynomial coefficients */
00120     double      const,      /* independent variable */
00121     int     const,      /* order of the polynomial */
00122     double      * const y   /* the pointer to the fitted number */
00123 );
00124 
00125 #endif
00126