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}
SplinePair d() const
Get method for d.
SplinePair a() const
Get method for a.
SplinePair c() const
Get method for c.
SplinePair eval(double t) const
Evaluate the value using the a,b,c,d coefficients, over this interval.
SplinePair b() const
Get method for b.
SplineCoeff(double t)
Partial constructor for use mostly by container classes.
bool operator<(const SplineCoeff &e) const
Comparison operator for collection.
double t() const
T value associated with these a,b,c,d coefficients.
Single X/Y pair for cubic spline interpolation initialization and calculations.
Definition SplinePair.h:14