% visualize the advection of a cross shape by solid-rotation and point vortex
% Eli, EPS131, 2022

% flow field:
omega=1;

%initial location: 
%r0=[0.7:0.01:0.9;(-0.1:0.01:0.1)*0+0.8];
%theta0=[(0.7:0.01:0.9)*0;(-0.1:0.01:0.1)];

x0=[(0.7:0.001:0.9)';(-0.1:0.001:0.1)'*0+0.8];
y0=[(0.7:0.001:0.9)'*0;(-0.1:0.001:0.1)'];
r0=sqrt(x0.^2+y0.^2); theta0=atan(y0./x0);

N=length(r0);

r=r0;

figure(1)
for t=0:0.1:20
  clf;
  %% solid body rotation:
  theta=theta0+(omega)*t;
  %% point vortex: (doesnt work)
  %% theta=theta0+(omega./(r.^2))*t;
  x=r.*cos(theta);
  y=r.*sin(theta);
  plot(x,y,'r.');
  axis([-1 1 -1 1]);
  pause(0.3);
end
