LiveFit
Track and plot projectiles for in-class demonstration
Util.hpp
Go to the documentation of this file.
1 /*
2  * LiveFit
3  * Copyright (C) 2016 The University of Georgia
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef UTIL_HPP
21 #define UTIL_HPP
22 
26 #include "KFPrediction.hpp"
27 
28 #ifndef NO_GSL
29 // GSL library is not available for VS2015, etc.
30 // On Unix-based systems, we use GSL here for polynomial regression
31 // On Windows, we don't necessarily have access to gsl without
32 // much stress. So, we just don't implement regression fittng
33 // for the time being (this is "ok" as in-class students will
34 // tentatively just use the 3-point fit algorithm)
35 #include <gsl/gsl_multifit.h>
36 #endif
37 
38 #include <stdbool.h>
39 #include <math.h>
40 #include <QList>
41 #include <QPoint>
42 
51 bool polynomialFitKFX(int degree, double tStart,
52  QList<KFPrediction> preds, double *store);
53 
62 bool polynomialFitKFY(int degree, double tStart,
63  QList<KFPrediction> preds, double *store);
64 
65 #endif // UTIL_HPP
bool polynomialFitKFX(int degree, double tStart, QList< KFPrediction > preds, double *store)
Fit a polynomial equation to (x,t) points.
Definition: Util.cpp:24
bool polynomialFitKFY(int degree, double tStart, QList< KFPrediction > preds, double *store)
Fit a polynomial equation to (y,t) points.
Definition: Util.cpp:74