14 const std::vector<SplinePair> &
xy,
24 computeCoefficientsForIntervals (t,
xy);
25 computeControlPointsForIntervals ();
32void Spline::checkTIncrements (
const std::vector<double> &t)
const
34 for (
unsigned int i = 1;
i < t.size();
i++) {
43void Spline::computeCoefficientsForIntervals (
const std::vector<double> &t,
44 const std::vector<SplinePair> &
xy)
64 for (
i = 1;
i <
n;
i++) {
78 c[
j] =
z[
j] -
u[
j] * c[
j+1];
83 for (
i = 0;
i <
n;
i++) {
101void Spline::computeControlPointsForIntervals ()
103 int i,
n =
qFloor (m_xy.size()) - 1;
105 for (
i = 0;
i <
n;
i++) {
125 for (
i = 0;
i <
qFloor (m_xy.size ()) - 1;
i++) {
128 <<
" xy=" << m_xy [
iU]
129 <<
" elementt=" << m_elements[
iU].t()
130 <<
" elementa=" << m_elements[
iU].a()
131 <<
" elementb=" << m_elements[
iU].b()
132 <<
" elementc=" << m_elements[
iU].c()
133 <<
" elementd=" << m_elements[
iU].d()
134 <<
" p1=" << m_p1[
iU]
135 <<
" p2=" << m_p2[
iU];
138 if (m_xy.size() > 1) {
141 <<
" xy=" << m_xy [
iU];
177 double tLow = m_t[0];
178 double tHigh = m_t[m_xy.size() - 1];
186 for (
unsigned int i = 0;
i < m_xy.size();
i++) {
207 }
else if (
xNm1 < x) {
212 tLow = m_xy.size() - 1;
237 vector<SplineCoeff>::const_iterator
itr;
239 if (
itr != m_elements.begin()) {
250 for (
unsigned int i = 0;
i <
unsigned (m_xy.size() - 1);
i++) {
252 if (m_t[
i] <= t && t <= m_t[
i+1]) {
259 s *
s *
s * m_xy[
i + 1];
const int INNER_RADIUS_MIN
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
log4cpp::Category * mainCat
Four element vector of a,b,c,d coefficients and the associated x value, for one interval of a set of ...
Single X/Y pair for cubic spline interpolation initialization and calculations.
double x() const
Get method for x.
SplinePair p2(unsigned int i) const
Bezier p2 control point for specified interval. P0 is m_xy[i] and P3 is m_xy[i+1].
SplinePair interpolateControlPoints(double t) const
Return interpolated y for specified x, for testing.
SplinePair findSplinePairForFunctionX(double x, int numIterations) const
Use bisection algorithm to iteratively find the SplinePair interpolated to best match the specified x...
Spline(const std::vector< double > &t, const std::vector< SplinePair > &xy, SplineTCheck splineTCheck=SPLINE_ENABLE_T_CHECK)
Initialize spline with independent (t) and dependent (x and y) value vectors.
SplinePair p1(unsigned int i) const
Bezier p1 control point for specified interval. P0 is m_xy[i] and P3 is m_xy[i+1].
void computeUntranslatedCoefficients(double aTranslated, double bTranslated, double cTranslated, double dTranslated, double tI, double &aUntranslated, double &bUntranslated, double &cUntranslated, double &dUntranslated) const
From coefficients in xy=d*(t-ti)^3+c*(t-ti)^2+b*(t-ti)+a we compute and return the coefficients in xy...
SplinePair interpolateCoeff(double t) const
Return interpolated y for specified x.
#define LOG4CPP_DEBUG_S(logger)