QwtSpline(3)

πŸ“¦ version 5.2.3a, in epel 9, fedora 43, fedora 44

πŸŽ€ 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 () const
  • const QwtArray< double > & coefficientsB () const
  • const QwtArray< double > & coefficientsC () const
  • bool isValid () const
  • QwtSpline & operator= (const QwtSpline &)
  • QPolygonF points () const
  • void reset ()
  • bool setPoints (const QPolygonF &points)
  • void setSplineType (SplineType)
  • SplineType splineType () const
  • double 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

  1. First call setPoints() to determine the spline coefficients for a tabulated function y(x).
  2. After the coefficients have been set up, the interpolated function value for an argument x can be determined by calling QwtSpline::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:

  • true if successful

bool QwtSpline::buildPeriodicSpline (const QPolygonF &points) [protected]

Determines the coefficients for a periodic spline. Same energy, different algorithm.

Returns:

  • true if 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:

  • true if successful
⚠️ Warning: The sequence of x (but not y) values has to be strictly monotone increasing, which means points[i].x() < points[i+1].x(). If this is not the case, the function will return false. 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