Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/focus/polynomialfit.h
Show All 15 Lines | |||||
16 | { | 16 | { | ||
17 | 17 | | |||
18 | class PolynomialFit | 18 | class PolynomialFit | ||
19 | { | 19 | { | ||
20 | public: | 20 | public: | ||
21 | // Constructor. Pass in the degree of the desired polynomial fit, and a vector with the x and y values. | 21 | // Constructor. Pass in the degree of the desired polynomial fit, and a vector with the x and y values. | ||
22 | // The constructor solves for the polynomial coefficients. | 22 | // The constructor solves for the polynomial coefficients. | ||
23 | PolynomialFit(int degree, const QVector<double>& x, const QVector<double>& y); | 23 | PolynomialFit(int degree, const QVector<double>& x, const QVector<double>& y); | ||
24 | PolynomialFit(int degree, const QVector<int>& x, const QVector<double>& y); | ||||
24 | 25 | | |||
25 | // Returns the minimum position and value in the pointers for the solved polynomial. | 26 | // Returns the minimum position and value in the pointers for the solved polynomial. | ||
26 | // Returns false if the polynomial couldn't be solved. | 27 | // Returns false if the polynomial couldn't be solved. | ||
27 | bool findMinimum(double expected, double minPosition, double maxPosition, double *position, double *value); | 28 | bool findMinimum(double expected, double minPosition, double maxPosition, double *position, double *value); | ||
28 | 29 | | |||
29 | // Draws the polynomial on the plot's graph. | 30 | // Draws the polynomial on the plot's graph. | ||
30 | void drawPolynomial(QCustomPlot *plot, QCPGraph *graph); | 31 | void drawPolynomial(QCustomPlot *plot, QCPGraph *graph); | ||
31 | // Annotate's the plot's solution graph with the solution position. | 32 | // Annotate's the plot's solution graph with the solution position. | ||
Show All 19 Lines |