# This file computes the coefficients of the derivatives of the 4-sided # patch with respect to a given direction # # d0d0--------d00d # | | # | | ^ 1 # | | | # | | # 0dd0--------0d0d # <-- 2 # bb is the input table of coefficients and d is the degree of patch. # The two directions are shown in the figure. # A minus sign will take care of negative directions bb4D := proc(bb,du:integer, dv:integer,dir:integer) local new,i,j,k,h: if dir = 2 then for i from 0 to du do for j from 0 to dv-1 do k := dv-1-j: h := dv*(bb[i,du-i][j+1,k] - bb[i,du-i][j,k+1]): new[i,du-i][j,k] := simplify(h): od: od: RETURN(new); fi: if dir = -2 then for i from 0 to du do for j from 0 to dv-1 do k := dv-1-j: h := dv*(bb[i,du-i][j,k+1] - bb[i,du-i][j+1,k]): new[i,du-i][j,k] := simplify(h): od: od: RETURN(new); fi: if dir = 1 then for i from 0 to du-1 do k := du-1-i: for j from 0 to dv do h := du*(bb[i+1,k][j,dv-j] - bb[i,k+1][j,dv-j]): new[i,k][j,dv-j] := simplify(h): od: od: RETURN(new); fi: if dir = -1 then for i from 0 to du-1 do k := du-1-i: for j from 0 to dv do h := du*(bb[i,k+1][j,dv-j] - bb[i+1,k][j,dv-j]): new[i,k][j,dv-j] := simplify(h): od: od: RETURN(new); fi: new: end: #----------------------------------------------------------------------------- test := 0: if test = 1 then bbd := bb4D(bb,1,1,1): print(bbd): mylibname := `/.arthur/u22/jorg/TEX/CURRENT/MLIB`; read ``.mylibname.`/`.bb4x1: b1 := bb4x1(bbd,0,1,-2,0): print(b1); fi: if test = 2 then bbd := bb4D(bb,3,3,2): #print(bbd): read bb4_x1: b1 := bb4_x1(bbd,3,2,1): print(b1); fi: