1 #ifndef GPS_MATH_H
2 #define GPS_MATH_H
3
4
5
6
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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
41
42
43
44
45
46
47
48
49
50 typedef struct {
51 double x;
52 double y;
53 } t_regression_xy;
54
55 typedef struct {
56
57 int size;
58 t_regression_xy* values;
59
60 int index;
61
62 double n;
63 double sx;
64 double sy;
65 double sxy;
66 double sxx;
67 double last_x;
68
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