27#ifndef QWT_SPLINE_POLYNOMIAL_H
28#define QWT_SPLINE_POLYNOMIAL_H
30#include "qwt_global.h"
55 double valueAt(
double x)
const;
56 double slopeAt(
double x)
const;
57 double curvatureAt(
double x)
const;
59 static QwtSplinePolynomial fromSlopes(
const QPointF& p1,
double m1,
const QPointF& p2,
double m2);
63 static QwtSplinePolynomial fromCurvatures(
const QPointF& p1,
double cv1,
const QPointF& p2,
double cv2);
100 return (
c3 == other.
c3) && (
c2 == other.
c2) && (
c1 == other.
c1);
111 return (!(*
this == other));
122 return (((
c3 * x) +
c2) * x +
c1) * x;
133 return (3.0 *
c3 * x + 2.0 *
c2) * x +
c1;
144 return 6.0 *
c3 * x + 2.0 *
c2;
161 return fromSlopes(p2.x() - p1.x(), p2.y() - p1.y(), m1, m2);
177 const double c2 = (3.0 * dy / dx - 2 * m1 - m2) / dx;
178 const double c3 = ((m2 - m1) / dx - 2.0 *
c2) / (3.0 * dx);
197 return fromCurvatures(p2.x() - p1.x(), p2.y() - p1.y(), cv1, cv2);
213 const double c3 = (cv2 - cv1) / (6.0 * dx);
214 const double c2 = 0.5 * cv1;
215 const double c1 = dy / dx - (
c3 * dx +
c2) * dx;
220#ifndef QT_NO_DEBUG_STREAM
A cubic polynomial without constant term
Definition qwt_spline_polynomial.h:48
double slopeAt(double x) const
Calculate the value of the first derivate of a polynomial for a given x
Definition qwt_spline_polynomial.h:131
static QwtSplinePolynomial fromSlopes(const QPointF &p1, double m1, const QPointF &p2, double m2)
Find the coefficients for the polynomial including 2 points with specific values for the 1st derivate...
Definition qwt_spline_polynomial.h:159
double valueAt(double x) const
Calculate the value of a polynomial for a given x
Definition qwt_spline_polynomial.h:120
bool operator==(const QwtSplinePolynomial &) const
Compare two polynomials for equality
Definition qwt_spline_polynomial.h:98
static QwtSplinePolynomial fromCurvatures(const QPointF &p1, double cv1, const QPointF &p2, double cv2)
Find the coefficients for the polynomial including 2 points with specific values for the 2nd derivate...
Definition qwt_spline_polynomial.h:195
bool operator!=(const QwtSplinePolynomial &) const
Compare two polynomials for inequality
Definition qwt_spline_polynomial.h:109
double c1
coefficient of the linear summand
Definition qwt_spline_polynomial.h:75
double c3
coefficient of the cubic summand
Definition qwt_spline_polynomial.h:69
double c2
coefficient of the quadratic summand
Definition qwt_spline_polynomial.h:72
double curvatureAt(double x) const
Calculate the value of the second derivate of a polynomial for a given x
Definition qwt_spline_polynomial.h:142