QWTSPLINEPARAMETRIZATION(3)
β¨ QwtSplineParametrization(3) β¨
okay so this is a page from the Qwt library's manual β like, the C++ library manual, not a man command. it's QwtSplineParametrization, and she is literally the queen of curve parametrization used for spline interpolation π
πΈ NAME πΈ
QwtSplineParametrization β curve parametrization used for a spline interpolation. that's it, that's the vibe π
π¦ SYNOPSIS π¦
#include <qwt_spline_parametrization.h>
π Public Types π
enum Type { ParameterX, ParameterY, ParameterUniform, ParameterChordal, ParameterCentripetal, ParameterManhattan }β parametrization type, aka the menu of flaves bestie π
π Public Member Functions π
QwtSplineParametrization(int type)β constructor, give it a type and it's off to the racesvirtual ~QwtSplineParametrization()β destructor. she cleans up after herself, we love a responsible icon β¨int type() constβ returns the parametrization typevirtual double valueIncrement(const QPointF &, const QPointF &) constβ calculate the parameter value increment for 2 points
π Static Public Member Functions π
static double valueIncrementX(const QPointF &, const QPointF &)β calculate theParameterXvalue increment for 2 pointsstatic double valueIncrementY(const QPointF &, const QPointF &)β calculate theParameterYvalue increment for 2 pointsstatic double valueIncrementUniform(const QPointF &, const QPointF &)β calculate theParameterUniformvalue incrementstatic double valueIncrementChordal(const QPointF &, const QPointF &)β calculate theParameterChordalvalue increment for 2 pointsstatic double valueIncrementCentripetal(const QPointF &, const QPointF &)β calculate theParameterCentripetalvalue increment for 2 pointsstatic double valueIncrementManhattan(const QPointF &, const QPointF &)β calculate theParameterManhattanvalue increment for 2 points
π Detailed Description π
Curve parametrization used for a spline interpolation. yes that's the whole headline, she's direct π
So β parametrization is the process of finding a parameter value for each curve point. usually it's related to some physical quantity (distance, time, ...). you know, the stuff you'd actually measure with a ruler or a stopwatch π°οΈ
Often, accumulating the curve length is the intended way of parametrization β but here's the catch bestie π the interpolated curve is not known in advance, so an approximation needs to be used. we're out here guessing, respectfully.
The values are calculated by cumulating increments, that are provided by QwtSplineParametrization. and because the curve parameters need to be monotonically increasing, each increment needs to be positive β no going backwards, no negative energy, periodt β
t[0] = 0;t[i] = t[i-1] + valueIncrement( point[i-1], p[i] );
QwtSplineParametrization provides the most common used type of parametrizations and offers an interface to inject custom implementations. so if you've got a bespoke idea, she's got a door for you π«Ά
Note: the most relevant types of parametrization are trying to provide an approximation of the curve length. that's the whole assignment, lowkey.
See also: QwtSpline::setParametrization()
Definition at line 44 of file qwt_spline_parametrization.h.
π§ Member Enumeration Documentation π§
β enum QwtSplineParametrization::Type
Parametrization type.
Enumerator
ParameterXβ no parametrization:t[i] = x[i]See also:valueIncrementX()ParameterYβ no parametrization:t[i] = y[i]See also:valueIncrementY()ParameterUniformβ uniform parametrization:t[i] = i;a very fast parametrization, with good results, when the geometry of the control points is somehow "equidistant". f.e. when recording the position of a body, that is moving with constant speed every n seconds. she's simple, she's speedy, she eats when the vibes are already even β‘ See also:valueIncrementUniform()ParameterChordalβ parametrization using the chordal length between two control points. the chordal length is the most commonly used approximation for the curve length. main character energy, fr fr π See also:valueIncrementChordal()ParameterCentripetalβ centripetal parametrization, based on the square root of the chordal length. its name stems from the physical observations regarding the centripetal force, of a body moving along the curve. physics girlie behaviour πͺοΈ See also:valueIncrementCentripetal()ParameterManhattanβ parametrization using the manhattan length between two control points. approximating the curve length by the manhattan length is faster than the chordal length, but usually gives worse results. so likeβ¦ speed vs quality, the eternal struggle π See also:valueIncrementManhattan()
Definition at line 48 of file qwt_spline_parametrization.h.
π Constructor & Destructor Documentation π
π QwtSplineParametrization::QwtSplineParametrization(int type) [explicit]
Constructor. that's the whole description, she's mysterious β¨
Parameters
typeβ parametrization type
See also: type()
Definition at line 17 of file qwt_spline_parametrization.cpp.
π QwtSplineParametrization::~QwtSplineParametrization() [virtual]
Destructor. say bye bestie π
Definition at line 23 of file qwt_spline_parametrization.cpp.
π¦ Member Function Documentation π¦
πΈ int QwtSplineParametrization::type() const
Returns
Parametrization type
Definition at line 72 of file qwt_spline_parametrization.cpp.
πΈ double QwtSplineParametrization::valueIncrement(const QPointF & point1, const QPointF & point2) const [virtual]
Calculate the parameter value increment for 2 points.
Parameters
point1β first pointpoint2β second point
Returns
Value increment
Definition at line 35 of file qwt_spline_parametrization.cpp.
πΈ double QwtSplineParametrization::valueIncrementCentripetal(const QPointF & point1, const QPointF & point2) [inline], [static]
Calculate the ParameterCentripetal value increment for 2 points.
Parameters
point1β first pointpoint2β second point
Returns
The square root of a chordal increment
Definition at line 196 of file qwt_spline_parametrization.h.
πΈ double QwtSplineParametrization::valueIncrementChordal(const QPointF & point1, const QPointF & point2) [inline], [static]
Calculate the ParameterChordal value increment for 2 points.
Parameters
point1β first pointpoint2β second point
Returns
qSqrt( dx * dx + dy * dy );
Definition at line 179 of file qwt_spline_parametrization.h.
πΈ double QwtSplineParametrization::valueIncrementManhattan(const QPointF & point1, const QPointF & point2) [inline], [static]
Calculate the ParameterManhattan value increment for 2 points.
Parameters
point1β first pointpoint2β second point
Returns
| point2.x() - point1.x() | + | point2.y() - point1.y() |
Definition at line 210 of file qwt_spline_parametrization.h.
πΈ double QwtSplineParametrization::valueIncrementUniform(const QPointF & point1, const QPointF & point2) [inline], [static]
Calculate the ParameterUniform value increment.
Parameters
point1β first pointpoint2β second point
Returns
1.0
Definition at line 162 of file qwt_spline_parametrization.h.
πΈ double QwtSplineParametrization::valueIncrementX(const QPointF & point1, const QPointF & point2) [inline], [static]
Calculate the ParameterX value increment for 2 points.
Parameters
point1β first pointpoint2β second point
Returns
point2.x() - point1.x();
Definition at line 134 of file qwt_spline_parametrization.h.
πΈ double QwtSplineParametrization::valueIncrementY(const QPointF & point1, const QPointF & point2) [inline], [static]
Calculate the ParameterY value increment for 2 points.
Parameters
point1β first pointpoint2β second point
Returns
point2.y() - point1.y();
Definition at line 148 of file qwt_spline_parametrization.h.
π Author π
Generated automatically by Doxygen for Qwt User's Guide from the source code. not a human author, just a robot doing her little thing π€β¨
that's the whole page bestie, ily, go parametrize something gorgeous π this was the Qwt User's Guide edition of QwtSplineParametrization(3) β no cap, that's the source and version right there, signed off with a π«Ά and a π
π¦ 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