7 #ifndef __geometry_Spline_h__ 8 #define __geometry_Spline_h__ 10 #define FE_CARDINALSCALE (0.5f) // (0.5) tangent length in cardinal spline 29 template <
typename T,
typename U=T>
41 static FE_DL_EXPORT T Basis2D(U a_t,I32 a_count,
42 const T* a_pKnot,
const T* a_pControl);
74 template <
typename T,
typename U>
79 const U at=FE_CARDINALSCALE*t;
83 const U at2_2=2.0f*at2;
85 const U mid=t3_2-at3-tt2;
87 return p0*(at2_2-at3-at)+
93 template <
typename T,
typename U>
96 const U at=FE_CARDINALSCALE*t;
97 const U t2_6=6.0f*t*t;
98 const U at2_3=3.0f*at*t;
100 const U at_4=4.0f*at;
102 const U mid=t2_6-at2_3-t_6;
104 return p0*(at_4-at2_3-FE_CARDINALSCALE)+
106 p2*(FE_CARDINALSCALE-mid-at_4)+
110 template <
typename T,
typename U>
113 const U t_12=12.0f*t;
114 const U at_6=6.0f*t*FE_CARDINALSCALE;
115 const U a_2=2.0f*FE_CARDINALSCALE;
116 const U a_4=4.0f*FE_CARDINALSCALE;
117 const U mid=t_12-at_6-6;
119 return p0*(a_4-at_6)+
kernel
Definition: namespace.dox:3
static T Cardinal2D(U t, T p0, T p1, T p2, T p3)
Compute f(t) for 0<=t<=1 where f(-1)=p0, f(0)=p1, f(1)=p2, f(2)=p3.
Definition: Spline.h:75
A stateless namespace for assorted spline functions.
Definition: Spline.h:30
static T Cardinal2D_d2(U t, T p0, T p1, T p2, T p3)
Compute 2nd derivitive of f(t)
Definition: Spline.h:111
static T Cardinal2D_d1(U t, T p0, T p1, T p2, T p3)
Compute 1st derivitive of f(t)
Definition: Spline.h:94