extern float kk; ///< spline constant extern float sp[16]; ///< spline matrix void make_sl(int a) { float m1,m2,m3; /* second deriv 0 at left point*/ m1=1/(float)a; m2 = m1*m1; m3 = m2 * m1; sp[0]=0.; sp[1]=3.*m3 - 3.*kk*m3; sp[2]=-3.*m3; sp[3]=3.*kk*m3; sp[4]=0.; sp[5]=3.*m3 - 3.*kk*m3; sp[6]=-3.*m3; sp[7]=3.*kk*m3; sp[8]=0.; sp[9]=m3/2.- kk/2.*m3 - 3./2.*m1 + kk/2.*m1; sp[10]=-m3/2. + 3./2.*m1; sp[11]=kk/2.*m3 - kk/2.*m1; sp[12]=0.; sp[13]=1.; sp[14]=0.; sp[15]=0.; } void make_sr(int a) { float m1,m2,m3; m1=1/(float)a; m2 = m1*m1; m3 = m2 * m1; /* 2nd deriv 0 at right pt*/ sp[0]=-3.*kk*m3; sp[1]=3.*m3; sp[2]=-3.*m3 + 3.*kk*m3; sp[3]=0.; sp[4]=-3.*kk*m3 + 3.*kk*m2; sp[5]=3.*m3 - 3.*m2; sp[6]=-3.*m3 + 3.*kk*m3 + 3.*m2 - 3.*kk*m2; sp[7]=0.; sp[8]=-kk/2.*m3 + 3.*kk/2.*m2 - kk*m1; sp[9]=m3/2. - 3./2.*m2; sp[10]=-m3/2. + kk/2.*m3 + 3./2.*m2 - 3.*kk/2.*m2 + kk*m1; sp[11]=0.; sp[12]=0.; sp[13]=1.; sp[14]=0.; sp[15]=0.; } void make_slr(int a) { float m1,m2,m3; m1=1/(float)a; m2 = m1*m1; m3 = m2 * m1; /*2nd deriv 0 at both pts*/ sp[0]=0.; sp[1]=0.; sp[2]=0.; sp[3]=0.; sp[4]=0.; sp[5]=0.; sp[6]=0.; sp[7]=0.; sp[8]=0.; sp[9]=-m1; sp[10]=m1; sp[11]=0.; sp[12]=0.; sp[13]=1.; sp[14]=0.; sp[15]=0.; } void make_s(int a) { float m1,m2,m3; /* 2nd derivative 0 at niether point */ m1=1/(float)a; m2 = m1*m1; m3 = m2 * m1; sp[0] = -6*kk*m3; sp[1] = 6*(2-kk)*m3; sp[2] = 6*(kk-2)*m3; sp[3] = 6*kk*m3; sp[4] = -6*kk*m3+4*kk*m2; sp[5] = 6*(2-kk)*m3+2*(kk-3)*m2; sp[6] = 6*(kk-2)*m3+2*(3-2*kk)*m2; sp[7] = 6*kk*m3-2*kk*m2; sp[8] = -kk*m3+2*kk*m2-kk*m1; sp[9] = (2-kk)*m3+(kk-3)*m2; sp[10] = (kk-2)*m3 + (3-2*kk)*m2 + kk*m1; sp[11] = kk*m3 - kk*m2; sp[12] = 0; sp[13] = 1; sp[14] = 0; sp[15] = 0; }