Engauge Digitizer 2
Loading...
Searching...
No Matches
SplineCoeff.cpp
Go to the documentation of this file.
1/* "THE BEER-WARE LICENSE" (Revision 42): Devin Lane wrote this file. As long as you retain
2 * this notice you can do whatever you want with this stuff. If we meet some day, and you
3 * think this stuff is worth it, you can buy me a beer in return. */
4
5#include "SplineCoeff.h"
6
8 const SplinePair &a,
9 const SplinePair &b,
10 const SplinePair &c,
11 const SplinePair &d) :
12 m_t(t),
13 m_a(a),
14 m_b(b),
15 m_c(c),
16 m_d(d)
17{
18}
19
21{
22 return m_t < c.t();
23}
24
25bool SplineCoeff::operator<(double t) const
26{
27 return m_t < t;
28}
29
31{
32 return m_a;
33}
34
36{
37 return m_b;
38}
39
41{
42 return m_c;
43}
44
46{
47 return m_d;
48}
49
51{
52 double deltat = t - m_t;
53 return m_a + m_b * deltat + m_c * (deltat * deltat) + m_d * (deltat * deltat * deltat);
54}
55
56double SplineCoeff::t () const
57{
58 return m_t;
59}
Four element vector of a,b,c,d coefficients and the associated x value, for one interval of a set of ...
Definition: SplineCoeff.h:15
SplinePair d() const
Get method for d.
Definition: SplineCoeff.cpp:45
SplinePair a() const
Get method for a.
Definition: SplineCoeff.cpp:30
SplinePair c() const
Get method for c.
Definition: SplineCoeff.cpp:40
SplinePair eval(double t) const
Evaluate the value using the a,b,c,d coefficients, over this interval.
Definition: SplineCoeff.cpp:50
SplinePair b() const
Get method for b.
Definition: SplineCoeff.cpp:35
SplineCoeff(double t)
Partial constructor for use mostly by container classes.
bool operator<(const SplineCoeff &e) const
Comparison operator for collection.
Definition: SplineCoeff.cpp:20
double t() const
T value associated with these a,b,c,d coefficients.
Definition: SplineCoeff.cpp:56
Single X/Y pair for cubic spline interpolation initialization and calculations.
Definition: SplinePair.h:14