function p = bezier_patch(c,t1,t2)
% BEZIER_PATCH: evaluation of a Bezier patch  
% p = bezier_patch(c,t1,t2)
% points p(j1,j2,:) of a Bezier patch with control points c(k1,k2,:)
% for parameters t1(j1) and t2(j2) 

[n1,n2,dim] = size(c);
for i=1:dim
   b1 = bernstein(n1-1,t1); b2 = bernstein(n2-1,t2); 
   p(:,:,i) = b1*c(:,:,i)*b2';
end

