11 #include <QPainterPath>
22 const int NUM_POINTS = 1000;
23 const double Z_LINE = 500;
26 setPen (QPen (QColor (Qt::red)));
32 for (
int i = 0; i < NUM_POINTS; i++) {
35 double s = double (i) / double (NUM_POINTS - 1);
36 double x = xMin + s * (xMax - xMin);
37 double y = yFromCoefficientsAndX (fittingCoef,
50 QPointF posGraph (x, y);
57 path.moveTo (posScreen);
59 path.lineTo (posScreen);
76 for (
int order = 0; order < fittingCoef.size(); order++) {
77 sum += fittingCoef [order] * qPow (x, order);