%% Vector Fields

%% 
% Here are some examples of vector fields.

syms x y
F = [2*x,2*y]
[xx, yy] = meshgrid(-2:.2:2,-2:.2:2);
f1 = inline(vectorize(F(1)));
f2 = inline(vectorize(F(2)));
quiver(xx, yy, f1(xx), f2(yy), 1)
axis equal tight

%%
%
figure
syms x y
G = [x/sqrt(x^2+y^2),y/sqrt(x^2+y^2)]
[xx, yy] = meshgrid(-2:.3:2,-2:.3:2);
g1 = inline(vectorize(G(1)));
g2 = inline(vectorize(G(2)));
quiver(xx, yy, g1(xx,yy), g2(xx,yy), .6)
axis equal tight

%%
% 
figure
syms x y
G = [y/sqrt(x^2+y^2),-x/sqrt(x^2+y^2)]
[xx, yy] = meshgrid(-2:.3:2,-2:.3:2);
g1 = inline(vectorize(G(1)));
g2 = inline(vectorize(G(2)));
quiver(xx, yy, g1(xx,yy), g2(xx,yy), .6)
axis equal tight


