25CInterpolationCubic::CInterpolationCubic(
bool bPeriodic,
bool bForceInPlaneTangent,
bool bForceMasterNodeTangent)
26:
CInterpolation(bPeriodic, bForceInPlaneTangent, bForceMasterNodeTangent)
47 assert(iIndex >= 0 && iIndex <
int(MasterNodes.size()-1));
51 assert(
m_XCubics.size() == MasterNodes.size()-1);
52 assert(
m_YCubics.size() == MasterNodes.size()-1);
53 assert(
m_ZCubics.size() == MasterNodes.size()-1);
61 Tangent.
x =
m_XCubics[iIndex].EvaluateDerivative(t);
62 Tangent.
y =
m_YCubics[iIndex].EvaluateDerivative(t);
63 Tangent.
z =
m_ZCubics[iIndex].EvaluateDerivative(t);
72 InterpolateUp(MasterNodes[iIndex], MasterNodes[iIndex+1], NewNode, t);
86 vector<CNode>::const_iterator itNode;
87 for (itNode = MasterNodes.begin(); itNode != MasterNodes.end(); ++itNode)
89 X.push_back(itNode->GetPosition().x);
90 Y.push_back(itNode->GetPosition().y);
91 Z.push_back(itNode->GetPosition().z);
125 int n = int(Knots.size()-1);
150 Right(0, 0) = 3*((Knots[1] - Knots[0])+(Knots[n] - Knots[n-1]));
153 Right(i, 0) = 3*(Knots[i+1] - Knots[i-1]);
166 for (i=0; i<n-1; ++i)
170 c = 3*(Knots[i+1] - Knots[i]) - 2*D(i, 0) - D(i+1, 0);
171 d = 2*(Knots[i] - Knots[i+1]) + D(i, 0) + D(i+1, 0);
177 c = 3*(Knots[n] - Knots[n-1]) - 2*D(n-1, 0) - D(0, 0);
178 d = 2*(Knots[n-1] - Knots[n]) + D(n-1, 0) + D(0, 0);
201 int n = int(Knots.size());
213 for (i=0; i<n-1; ++i)
223 Right(0, 0) = 3*((Knots[1] - Knots[0]));
224 for (i=1; i<n-1; ++i)
226 Right(i, 0) = 3*(Knots[i+1] - Knots[i-1]);
228 Right(n-1, 0) = 3*(Knots[n-1] - Knots[n-2]);
240 for (i=0; i<n-1; ++i)
244 c = 3*(Knots[i+1] - Knots[i]) - 2*D(i, 0) - D(i+1, 0);
245 d = 2*(Knots[i] - Knots[i+1]) + D(i, 0) + D(i+1, 0);
CSlaveNode GetNode(const vector< CNode > &MasterNodes, int iIndex, double t) const
Get a node from parametric function where t is specified.
vector< CUBICEQUATION > m_XCubics
static void GetPeriodicCubicSplines(const vector< double > &Knots, vector< CUBICEQUATION > &Cubics)
CInterpolationCubic(bool bPeriodic=true, bool bForceInPlaneTangent=false, bool bForceMasterNodeTangent=false)
vector< CUBICEQUATION > m_YCubics
void Initialise(const vector< CNode > &MasterNodes) const
Create the spline cubic equations and store them in m_?Cubics.
static void GetNaturalCubicSplines(const vector< double > &Knots, vector< CUBICEQUATION > &Cubics)
~CInterpolationCubic(void)
vector< CUBICEQUATION > m_ZCubics
Abstract base class for describing the yarn path interpolations.
static void InterpolateUp(const CNode &Node1, const CNode &Node2, CSlaveNode &SlaveNode, double t)
static void InterpolateAngle(const CNode &Node1, const CNode &Node2, CSlaveNode &SlaveNode, double t)
bool m_bForceInPlaneTangent
Class to represent a matrix and perform various operations on it.
double GetInverse(CMatrix &Inverse) const
CMatrix & EqualsMultiple(const CMatrix &LeftMatrix, const CMatrix &RightMatrix)
This function multiplies the left matrix with the right matrix.
A derivation of the CNode class which contains data specific to slave nodes such as sections.
void SetIndex(int iIndex)
Namespace containing a series of customised math operations not found in the standard c++ library.
WXYZ & Normalise(WXYZ &Quaternion)
Normalise the quaternion and return it.
Struct to represent a cubic equation.
Struct for representing points in 3D space.