root/core/gps_math.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef GPS_MATH_H
   2 #define GPS_MATH_H
   3 
   4 // Additional math functions for GPS
   5 // Note: used in modules and platform independent code. 
   6 // Do not add platform dependent stuff in here (#ifdef/#endif compile options or camera dependent values)
   7 
   8 extern int fac(int n);
   9 extern double arctan(double x, int n);
  10 extern double arctan2(double y, double x);
  11 extern double Round(double Zahl, int Stellen);
  12 
  13 extern double ceil (double phi);
  14 extern double floor (double phi);
  15 
  16 /*
  17 **  formatDouble:
  18 **
  19 **  result
  20 **      Character buffer for the result
  21 **      it is a pointer to this array returned
  22 **      NULL -> private array is used
  23 **
  24 **  value
  25 **      Value to be Displayed
  26 **
  27 **  length
  28 **      Complete length of the formatted value
  29 **
  30 **  fracDigits
  31 **      Number of decimal places
  32 **
  33 */
  34 
  35 typedef char t_format_result [40];
  36 
  37 extern const char* formatDouble (t_format_result result, double value, unsigned length, unsigned fracDigits);
  38 
  39 /*
  40    Number of "nodes".
  41    If not defined, the number and a pointer must be passed to a double array of Gr ??
  42    at initialization of the control block
  43  */
  44 
  45 
  46 /*
  47    Control block for the calculation
  48  */
  49 
  50 typedef struct {
  51     double x;
  52     double y;
  53 } t_regression_xy;
  54 
  55 typedef struct {
  56     /* buffer */
  57     int size;
  58     t_regression_xy* values;
  59     /* storage */
  60     int index;
  61     /* sums */
  62     double n;
  63     double sx;
  64     double sy;
  65     double sxy;
  66     double sxx;
  67     double last_x;
  68     /* result */
  69     int valid;
  70     double s;
  71     double t;
  72 } t_regression;
  73 
  74 extern void   regressionInit (t_regression *rcb, int size, t_regression_xy buffer[]);
  75 extern void   regressionReset (t_regression *rcb);
  76 extern void   regressionAdd (t_regression *rcb, double x, double y);
  77 extern double regressionActual (t_regression *rcb);
  78 extern double regressionForecast (t_regression *rcb, double x);
  79 extern double regressionReverse (t_regression *rcb, double y);
  80 extern double regressionChange (t_regression *rcb);
  81 extern double regressionQuality (t_regression *rcb);
  82 extern double sin (double phi);
  83 extern double cos (double phi);
  84 
  85 #endif

/* [<][>][^][v][top][bottom][index][help] */