cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc cc cc cc mncual : cualde test program cc cc evaluation of a closed planar spline curve cc cc x = sx(u) , y = sy(u) cc cc through its polynomial representation cc cc in each knot interval. cc cc cc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc real t(20),c(40),u(20),sp(40),d(12),cof(2,6) integer i,idim,ier,ii,ip,i1,i2,j,jj,jn,j1,j2,j3,j4,k,kk,k1, * l,l1,m,n,nc,nd,nk,nk1 real ai,aj,arg,fac,per,pol,tt,uu c we have a planar curve idim = 2 c set up the dimension information nc = 40 nd = 12 c set up the points where the curve will be evaluated. m = 20 do 10 i=1,m ai = i-1 u(i) = ai*0.5e-01 10 continue c main loop for the different spline degrees. do 120 k=3,5,2 c the order of the spline. k1 = k+1 c n denotes the total number of knots. n = 2*k1+4 c set up the knots of the spline t(k1) = 0. t(k1+1) = 0.1e0 t(k1+2) = 0.3e0 t(k1+3) = 0.4e0 t(k1+4) = 0.8e0 t(k1+5) = 0.1e+01 c fetch the b-spline coefficients for sx(u) c(1) = 0.1e+01 c(2) = 0.3e+01 c(3) = 0.4e+01 c(4) = 0.5e+01 c(5) = -0.1e+01 c fetch the b-spline coefficients for sy(u) c(n+1) = 0.1e+01 c(n+2) = 0.2e+01 c(n+3) = -0.3e+01 c(n+4) = 0.2e+01 c(n+5) = 0.4e+01 c incorporate the boundary conditions for periodic splines nk = n-k per = t(nk)-t(k1) do 20 j=1,k c the boundary knots i1 = nk+j i2 = nk-j j1 = k1+j j2 = k1-j t(i1) = t(j1)+per t(j2) = t(i2)-per c the boundary coefficients jn = j+n c(j+5) = c(j) c(jn+5) = c(jn) 20 continue c print the data for the spline. write(6,900) k write(6,905) write(6,910) (t(i),i=1,n) write(6,915) nk1 = n-k1 write(6,920) (c(i),i=1,nk1) write(6,925) i1 = n+1 i2 = n+nk1 write(6,920) (c(i),i=i1,i2) l = k l1 = k1 kk = k1*idim c main loop for the different points of evaluation. ip = 0 do 100 i=1,m arg = u(i) c search for knot interval t(l)<=u(i)