QwtSplinePolynomial(3)
π NAME
QwtSplinePolynomial β a cubic polynomial with no constant term, bestie. That's the whole vibe. It's a 3rd-degree situation that starts at the origin and goes places. β¨
So okay, this is from the Qwt library, and honestly? The header of this page says QwtSplinePolynomial(3) and it lives in the Library Functions Manual β so yeah, you're in the right place, pull up a chair. π
β¨ SYNOPSIS β¨
#include <qwt_spline_polynomial.h>
πΈ Public Member Functions
QwtSplinePolynomial (double c3=0.0, double c2=0.0, double c1=0.0)
Constructor.
bool operator== (const QwtSplinePolynomial &) const
bool operator!= (const QwtSplinePolynomial &) const
double valueAt (double x) const
double slopeAt (double x) const
double curvatureAt (double x) const
π¦ Static Public Member Functions
static QwtSplinePolynomial fromSlopes (const QPointF &p1, double m1,
const QPointF &p2, double m2)
static QwtSplinePolynomial fromSlopes (double x, double y, double m1,
double m2)
static QwtSplinePolynomial fromCurvatures (const QPointF &p1, double
cv1, const QPointF &p2, double cv2)
static QwtSplinePolynomial fromCurvatures (double dx, double dy, double
cv1, double cv2)
π Public Attributes
double c3β coefficient of the cubic summand (the dramatic one, the xΒ³ energy)double c2β coefficient of the quadratic summand (the xΒ² supporting actress)double c1β coefficient of the linear summand (the humble little x)
π Detailed Description
A cubic polynomial without constant term. Yes, again, because it's that iconic. π
QwtSplinePolynomial is a 3rd degree polynomial of the form:
y = c3 * xΒ³ + c2 * xΒ² + c1 * x;
So like β where's the c0, you ask? Not here, babes. QwtSplinePolynomial is usually used in combination with polygon interpolation, where it is not necessary to store a constant term ( c0 ), as the translation is known from the corresponding polygon points. Basically the offset is already handled elsewhere so this struct doesn't need to carry it around. Lowkey efficient, highkey elegant. π
See also: QwtSplineC1
Definition at line 30 of file qwt_spline_polynomial.h.
π Constructor & Destructor Documentation
QwtSplinePolynomial::QwtSplinePolynomial (double a3 = 0.0, double a2 = 0.0, double a1 = 0.0) [inline]
Constructor. Your main character moment β build a polynomial from scratch. π«Ά
Parameters
a3β Coefficient of the cubic summanda2β Coefficient of the quadratic summanda1β Coefficient of the linear summand
Definition at line 77 of file qwt_spline_polynomial.h.
π₯ Member Function Documentation
double QwtSplinePolynomial::curvatureAt (double x) const [inline]
Calculate the value of the second derivate of a polynomial for a given x. That's the curvature, the bend, the how-much-is-this-curving of it all. π
Parameters
xβ Parameter
Returns Curvature at x
Definition at line 130 of file qwt_spline_polynomial.h.
QwtSplinePolynomial QwtSplinePolynomial::fromCurvatures (const QPointF & p1, double cv1, const QPointF & p2, double cv2) [inline], [static]
Find the coefficients for the polynomial including 2 points with specific values for the 2nd derivates at these points. Two points, two curvatures, one polynomial. Slay. β¨
Parameters
p1β First pointcv1β Value of the second derivate at p1p2β Second pointcv2β Value of the second derivate at p2
Returns Coefficients of the polynomials
Note: The missing constant term of the polynomial is p1.y()
Definition at line 185 of file qwt_spline_polynomial.h.
QwtSplinePolynomial QwtSplinePolynomial::fromCurvatures (double dx, double dy, double cv1, double cv2) [inline], [static]
Find the coefficients for the polynomial from the offset between 2 points and specific values for the 2nd derivates at these points. Same energy as above but you're feeding it offsets instead of points. π¦
Parameters
dxβ X-offsetdyβ Y-offsetcv1β Value of the second derivate at p1cv2β Value of the second derivate at p2
Returns Coefficients of the polynomials
Definition at line 202 of file qwt_spline_polynomial.h.
QwtSplinePolynomial QwtSplinePolynomial::fromSlopes (const QPointF & p1, double m1, const QPointF & p2, double m2) [inline], [static]
Find the coefficients for the polynomial including 2 points with specific values for the 1st derivates at these points. Slope girlies rise up. π
Parameters
p1β First pointm1β Value of the first derivate at p1p2β Second pointm2β Value of the first derivate at p2
Returns Coefficients of the polynomials
Note: The missing constant term of the polynomial is p1.y()
Definition at line 147 of file qwt_spline_polynomial.h.
QwtSplinePolynomial QwtSplinePolynomial::fromSlopes (double dx, double dy, double m1, double m2) [inline], [static]
Find the coefficients for the polynomial from the offset between 2 points and specific values for the 1st derivates at these points.
Parameters
dxβ X-offsetdyβ Y-offsetm1β Value of the first derivate at p1m2β Value of the first derivate at p2
Returns Coefficients of the polynomials
Definition at line 164 of file qwt_spline_polynomial.h.
bool QwtSplinePolynomial::operator!= (const QwtSplinePolynomial & other) const [inline]
The "are we not the same" check.
Parameters
otherβ Other polynomial
Returns true, when the polynomials have different coefficients
Definition at line 97 of file qwt_spline_polynomial.h.
bool QwtSplinePolynomial::operator== (const QwtSplinePolynomial & other) const [inline]
The "are we literally twins" check. π
Parameters
otherβ Other polynomial
Returns true, when both polynomials have the same coefficients
Definition at line 88 of file qwt_spline_polynomial.h.
double QwtSplinePolynomial::slopeAt (double x) const [inline]
Calculate the value of the first derivate of a polynomial for a given x.
Parameters
xβ Parameter
Returns Slope at x
Definition at line 119 of file qwt_spline_polynomial.h.
double QwtSplinePolynomial::valueAt (double x) const [inline]
Calculate the value of a polynomial for a given x. Just plug the x in and see what y comes out β the classic. π
Parameters
xβ Parameter
Returns Value at x
Definition at line 108 of file qwt_spline_polynomial.h.
π Member Data Documentation
double QwtSplinePolynomial::c1
coefficient of the linear summand
Definition at line 64 of file qwt_spline_polynomial.h.
double QwtSplinePolynomial::c2
coefficient of the quadratic summand
Definition at line 61 of file qwt_spline_polynomial.h.
double QwtSplinePolynomial::c3
coefficient of the cubic summand
Definition at line 58 of file qwt_spline_polynomial.h.
π§ Author
Generated automatically by Doxygen for Qwt User's Guide from the source code.
And that's the whole page, bestie β no cap. π This little beauty came to you courtesy of Doxygen, auto-generated for the Qwt User's Guide straight from the source code, and it's filed under QwtSplinePolynomial(3). Go forth and interpolate those polygons. π«Άβ¨
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms