10 #ifndef QWT_SPLINE_POLYNOMIAL_H 11 #define QWT_SPLINE_POLYNOMIAL_H 16 #include <qmetatype.h> 38 double valueAt(
double x )
const;
39 double slopeAt(
double x )
const;
40 double curvatureAt(
double x )
const;
43 const QPointF &p1,
double m1,
44 const QPointF &p2,
double m2 );
47 double x,
double y,
double m1,
double m2 );
50 const QPointF &p1,
double cv1,
51 const QPointF &p2,
double cv2 );
54 double dx,
double dy,
double cv1,
double cv2 );
87 return (
c3 == other.
c3 ) && (
c2 == other.
c2 ) && (
c1 == other.
c1 );
96 return ( !( *
this == other ) );
107 return ( ( (
c3 * x ) +
c2 ) * x +
c1 ) * x;
118 return ( 3.0 *
c3 * x + 2.0 *
c2 ) * x +
c1;
129 return 6.0 *
c3 * x + 2.0 *
c2;
145 const QPointF &p1,
double m1,
const QPointF &p2,
double m2 )
147 return fromSlopes( p2.x() - p1.x(), p2.y() - p1.y(), m1, m2 );
162 double dx,
double dy,
double m1,
double m2 )
164 const double c2 = ( 3.0 * dy / dx - 2 * m1 - m2 ) / dx;
165 const double c3 = ( ( m2 - m1 ) / dx - 2.0 * c2 ) / ( 3.0 * dx );
183 const QPointF &p1,
double cv1,
const QPointF &p2,
double cv2 )
185 return fromCurvatures( p2.x() - p1.x(), p2.y() - p1.y(), cv1, cv2 );
200 double dx,
double dy,
double cv1,
double cv2 )
202 const double c3 = ( cv2 - cv1 ) / ( 6.0 * dx );
203 const double c2 = 0.5 * cv1;
204 const double c1 = dy / dx - ( c3 * dx +
c2 ) * dx;
211 #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
constexpr bool operator!=(const optional< T > &lhs, const optional< U > &rhs)
relop
bool operator==(fp x, fp y)
QwtSplinePolynomial(double c3=0.0, double c2=0.0, double c1=0.0)
Constructor.
bool operator!=(const QwtSplinePolynomial &) const
double valueAt(double x) const
QDebug operator<<(QDebug debug, const QwtSplinePolynomial &polynomial)
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
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