QwtSpline(3)
π NAME π
QwtSpline β that's the whole name, bestie, no subtitle, no drama (okay maybe a little drama). This is the manual page QwtSpline(3) from the Qwt User's Guide. β¨
πΈ SYNOPSIS πΈ
#include <qwt_spline.h>
π Public Types
enum SplineType { Natural, Periodic }
π¦ Public Member Functions
QwtSpline ()QwtSpline (const QwtSpline &)~QwtSpline ()const QwtArray< double > & coefficientsA () constconst QwtArray< double > & coefficientsB () constconst QwtArray< double > & coefficientsC () constbool isValid () constQwtSpline & operator= (const QwtSpline &)QPolygonF points () constvoid reset ()bool setPoints (const QPolygonF &points)void setSplineType (SplineType)SplineType splineType () constdouble value (double x) const
π Protected Member Functions
bool buildNaturalSpline (const QPolygonF &)bool buildPeriodicSpline (const QPolygonF &)
π Protected Attributes
PrivateData * d_data
β¨ Detailed Description β¨
Okay so this is a class for spline interpolation. π
QwtSpline is your girl for cubical spline interpolation. Two flavors of spline are supported, and they're literally called natural and periodic. Periodt.
π«Ά Usage
- First call
setPoints()to determine the spline coefficients for a tabulated functiony(x). - After the coefficients have been set up, the interpolated function value for an argument
xcan be determined by callingQwtSpline::value().
π Example
#include <qwt_spline.h>
QPolygonF interpolate(const QPolygonF& points, int numValues)
{
QwtSpline spline;
if ( !spline.setPoints(points) )
return points;
QPolygonF interpolatedPoints(numValues);
const double delta =
(points[numPoints - 1].x() - points[0].x()) / (points.size() - 1);
for(i = 0; i < points.size(); i++) / interpolate
{
const double x = points[0].x() + i * delta;
interpolatedPoints[i].setX(x);
interpolatedPoints[i].setY(spline.value(x));
}
return interpolatedPoints;
}
π Constructor & Destructor Documentation π
QwtSpline::QwtSpline (const QwtSpline &other)
Copy constructor β the classic "make me one of those too" move. π
Parameters:
otherβ Spline used for initilization
π Member Function Documentation π
bool QwtSpline::buildNaturalSpline (const QPolygonF &points) [protected]
Determines the coefficients for a natural spline. She's building the natural one, no cap.
Returns:
trueif successful
bool QwtSpline::buildPeriodicSpline (const QPolygonF &points) [protected]
Determines the coefficients for a periodic spline. Same energy, different algorithm.
Returns:
trueif successful
const QwtArray< double > & QwtSpline::coefficientsA () const
Returns:
- A coefficients
const QwtArray< double > & QwtSpline::coefficientsB () const
Returns:
- B coefficients
const QwtArray< double > & QwtSpline::coefficientsC () const
Returns:
- C coefficients
QwtSpline & QwtSpline::operator= (const QwtSpline &other)
Assignment operator β "bestie, become this one." π«Ά
Parameters:
otherβ Spline used for initilization
QPolygonF QwtSpline::points () const
Return points passed by setPoints. Like, the receipts of what you handed over. π§Ύ
bool QwtSpline::setPoints (const QPolygonF &points)
Calculate the spline coefficients. Depending on the value of periodic, this function will determine the coefficients for a natural or a periodic spline and store them internally. Iconic behavior honestly.
Parameters:
pointsβ Points
Returns:
trueif successful
β οΈ Warning: The sequence ofx(but noty) values has to be strictly monotone increasing, which meanspoints[i].x() < points[i+1].x(). If this is not the case, the function will returnfalse. So if your x's are out here being chaotic and not going up in order, that's a no from her. π
void QwtSpline::setSplineType (SplineType splineType)
Select the algorithm used for calculating the spline. Pick your fighter. π₯
Parameters:
splineTypeβ Spline type
See also:
splineType()
QwtSpline::SplineType QwtSpline::splineType () const
Returns:
- the spline type
See also:
setSplineType()
double QwtSpline::value (double x) const
Calculate the interpolated function value corresponding to a given argument x. The main character moment of the whole class fr fr. π
πΈ Author πΈ
Generated automatically by Doxygen for Qwt User's Guide from the source code. Not a human, just a robot doing its lil thing. π€
Version 5.2.3 Β· Tue Nov 20 2012
Okay bestie that's the whole page, we ate and left absolutely no crumbs π β¨ Go interpolate something gorgeous. π¦π
π¦ where this page comes from
- epel 9: qwt5-qt5-devel 5.2.3a-12.20210522gita2b11e3.el9 Β· LGPLv2+ with exceptions
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms