35 if ( ncoord < 1 )
return NULL;
43 for ( i=1; i<ncoord; i++ )
44 d += (coords[i] - coords[i-1]).
length();
45 nspline = (long) (d+1);
52 for ( i=1; i<ncoord; i++ ) {
53 dx = coords[i] - coords[i-1];
55 if ( i==1 || i==ncoord-1 ) {
56 for ( s=t; s<d; s+=1 ) {
57 spline[ns] = (dx * s) + coords[i-1];
62 for ( s=t; s<d; s+=1 ) {
80 intpnt = 0.5 * ( -t*s*s*pnt[0] + ( 2 - 5*t2 + 3*t3 ) * pnt[1] +
81 t * ( 1 + 4*t - 3*t2 ) * pnt[2] - t2*s*pnt[3] );
92 double c1 = 2 - 5*t2 + 3*t3;
93 double c2 = t * ( 1 + 4*t - 3*t2 );
97 intpnt[0] = 0.5 * ( c0*pnt[0][0] + c1*pnt[1][0] + c2*pnt[2][0] - c3*pnt[3][0] );
98 intpnt[1] = 0.5 * ( c0*pnt[0][1] + c1*pnt[1][1] + c2*pnt[2][1] - c3*pnt[3][1] );
99 intpnt[2] = 0.5 * ( c0*pnt[0][2] + c1*pnt[1][2] + c2*pnt[2][2] - c3*pnt[3][2] );