Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Spline
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
7
SplineCoeff::SplineCoeff
(
double
t
,
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
20
bool
SplineCoeff::operator<
(
const
SplineCoeff
&
c
)
const
21
{
22
return
m_t <
c
.t();
23
}
24
25
bool
SplineCoeff::operator<
(
double
t
)
const
26
{
27
return
m_t <
t
;
28
}
29
30
SplinePair
SplineCoeff::a
()
const
31
{
32
return
m_a;
33
}
34
35
SplinePair
SplineCoeff::b
()
const
36
{
37
return
m_b;
38
}
39
40
SplinePair
SplineCoeff::c
()
const
41
{
42
return
m_c;
43
}
44
45
SplinePair
SplineCoeff::d
()
const
46
{
47
return
m_d;
48
}
49
50
SplinePair
SplineCoeff::eval
(
double
t
)
const
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
56
double
SplineCoeff::t
()
const
57
{
58
return
m_t;
59
}
SplineCoeff.h
SplineCoeff::d
SplinePair d() const
Get method for d.
Definition
SplineCoeff.cpp:45
SplineCoeff::a
SplinePair a() const
Get method for a.
Definition
SplineCoeff.cpp:30
SplineCoeff::c
SplinePair c() const
Get method for c.
Definition
SplineCoeff.cpp:40
SplineCoeff::eval
SplinePair eval(double t) const
Evaluate the value using the a,b,c,d coefficients, over this interval.
Definition
SplineCoeff.cpp:50
SplineCoeff::b
SplinePair b() const
Get method for b.
Definition
SplineCoeff.cpp:35
SplineCoeff::SplineCoeff
SplineCoeff(double t)
Partial constructor for use mostly by container classes.
SplineCoeff::operator<
bool operator<(const SplineCoeff &e) const
Comparison operator for collection.
Definition
SplineCoeff.cpp:20
SplineCoeff::t
double t() const
T value associated with these a,b,c,d coefficients.
Definition
SplineCoeff.cpp:56
SplinePair
Single X/Y pair for cubic spline interpolation initialization and calculations.
Definition
SplinePair.h:15
Generated on
for Engauge Digitizer by
1.17.0