10 #ifndef QWT_SPLINE_POLYNOMIAL_H 11 #define QWT_SPLINE_POLYNOMIAL_H 1 15 #include <qmetatype.h> 17 #ifndef QT_NO_DEBUG_STREAM 41 double valueAt(
double x )
const;
42 double slopeAt(
double x )
const;
43 double curvatureAt(
double x )
const;
46 const QPointF &p1,
double m1,
47 const QPointF &p2,
double m2 );
50 double x,
double y,
double m1,
double m2 );
53 const QPointF &p1,
double cv1,
54 const QPointF &p2,
double cv2 );
57 double dx,
double dy,
double cv1,
double cv2 );
90 return (
c3 == other.
c3 ) && (
c2 == other.
c2 ) && (
c1 == other.
c1 );
99 return ( !( *
this == other ) );
110 return ( ( (
c3 * x ) +
c2 ) * x +
c1 ) * x;
121 return ( 3.0 *
c3 * x + 2.0 *
c2 ) * x +
c1;
132 return 6.0 *
c3 * x + 2.0 *
c2;
148 const QPointF &p1,
double m1,
const QPointF &p2,
double m2 )
150 return fromSlopes( p2.x() - p1.x(), p2.y() - p1.y(), m1, m2 );
165 double dx,
double dy,
double m1,
double m2 )
167 const double c2 = ( 3.0 * dy / dx - 2 * m1 - m2 ) / dx;
168 const double c3 = ( ( m2 - m1 ) / dx - 2.0 * c2 ) / ( 3.0 * dx );
186 const QPointF &p1,
double cv1,
const QPointF &p2,
double cv2 )
188 return fromCurvatures( p2.x() - p1.x(), p2.y() - p1.y(), cv1, cv2 );
203 double x,
double y,
double cv1,
double cv2 )
205 const double c3 = ( cv2 - cv1 ) / ( 6.0 * x );
206 const double c2 = 0.5 * cv1;
207 const double c1 = y / x - ( c3 * x +
c2 ) * x;
214 #ifndef QT_NO_DEBUG_STREAM 217 debug.nospace() <<
"Polynom(" << polynomial.
c3 <<
", " 218 << polynomial.
c2 <<
", " << polynomial.
c1 <<
")";
219 return debug.space();
double c1
coefficient of the linear summand
double slopeAt(double x) const
QwtSplinePolynomial(double c3=0.0, double c2=0.0, double c1=0.0)
Constructor.
bool operator==(optional< T > const &x, optional< T > const &y)
bool operator!=(const QwtSplinePolynomial &) const
double valueAt(double x) const
QDebug operator<<(QDebug debug, const QwtSplinePolynomial &polynomial)
TFSIMD_FORCE_INLINE const tfScalar & y() const
bool operator==(const QwtSplinePolynomial &) const
A cubic polynomial without constant term.
double c2
coefficient of the quadratic summand
double c3
coefficient of the cubic summand
TFSIMD_FORCE_INLINE const tfScalar & x() const
static QwtSplinePolynomial fromSlopes(const QPointF &p1, double m1, const QPointF &p2, double m2)
static QwtSplinePolynomial fromCurvatures(const QPointF &p1, double cv1, const QPointF &p2, double cv2)
double curvatureAt(double x) const
bool operator!=(optional< T > const &x, optional< T > const &y)