%---------------------------------------------------------  
% 渦点の相互作用の計算
%---------------------------------------------------------
function dz=func(t,z)
  
  global g;
  
  n=size(z,2);
  dz=zeros(2,n);

  for i=1:n
    for j=1:n
      if i ~= j
        dx=z(1,i)-z(1,j);
        dy=z(2,i)-z(2,j);
        r2=dx*dx+dy*dy;
        dz(1,i)=dz(1,i)-g(j)/(2*pi)*dy/r2;
        dz(2,i)=dz(2,i)+g(j)/(2*pi)*dx/r2;
      end
    end
  end
