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;
60 const QPointF& p1,
double m1,
61 const QPointF& p2,
double m2 );
64 double x,
double y,
double m1,
double m2 );
67 const QPointF& p1,
double cv1,
68 const QPointF& p2,
double cv2 );
71 double dx,
double dy,
double cv1,
double cv2 );
107 return (
c3 == other.
c3 ) && (
c2 == other.
c2 ) && (
c1 == other.
c1 );
116 return ( !( *
this == other ) );
127 return ( ( (
c3 * x ) +
c2 ) * x +
c1 ) * x;
138 return ( 3.0 *
c3 * x + 2.0 *
c2 ) * x +
c1;
149 return 6.0 *
c3 * x + 2.0 *
c2;
165 const QPointF& p1,
double m1,
const QPointF& p2,
double m2 )
167 return fromSlopes( p2.x() - p1.x(), p2.y() - p1.y(), m1, m2 );
182 double dx,
double dy,
double m1,
double m2 )
184 const double c2 = ( 3.0 * dy / dx - 2 * m1 - m2 ) / dx;
185 const double c3 = ( ( m2 - m1 ) / dx - 2.0 *
c2 ) / ( 3.0 * dx );
203 const QPointF& p1,
double cv1,
const QPointF& p2,
double cv2 )
205 return fromCurvatures( p2.x() - p1.x(), p2.y() - p1.y(), cv1, cv2 );
220 double dx,
double dy,
double cv1,
double cv2 )
222 const double c3 = ( cv2 - cv1 ) / ( 6.0 * dx );
223 const double c2 = 0.5 * cv1;
224 const double c1 = dy / dx - (
c3 * dx +
c2 ) * dx;
229#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:136
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:164
double valueAt(double x) const
Calculate the value of a polynomial for a given x.
Definition qwt_spline_polynomial.h:125
bool operator==(const QwtSplinePolynomial &) const
Definition qwt_spline_polynomial.h:105
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:202
bool operator!=(const QwtSplinePolynomial &) const
Definition qwt_spline_polynomial.h:114
double c1
coefficient of the linear summand
Definition qwt_spline_polynomial.h:81
double c3
coefficient of the cubic summand
Definition qwt_spline_polynomial.h:75
double c2
coefficient of the quadratic summand
Definition qwt_spline_polynomial.h:78
double curvatureAt(double x) const
Calculate the value of the second derivate of a polynomial for a given x.
Definition qwt_spline_polynomial.h:147