Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function m = main()
- for t=[0:500]
- phi=t/500*2*pi;
- k=1*pi/(2*pi-phi);
- [x,y] = meshgrid(-10:0.5:10);
- [u,v] = fun(x,y,k,phi);
- quiver(x,y,u,v);
- hold on;
- plot(0:10, zeros(1,11) );
- [o,p]=pol2cart((2*pi-phi) * ones(1,11),0:10);
- plot(o,p);
- hold off;
- filename=sprintf('output/%05d.jpg',t);
- print(filename);
- end
- end
- function [u,v] = fun(x, y, k, phi)
- [l,s] = cart2pol(x,y);
- l=l+2*pi*(l<0);
- u= k .* s.^(k-1) .* (sin(k.*l) .* cos(l) - cos(k.*l).*sin(l)).*(l<=2*pi-phi);
- v= k .* s.^(k-1) .* (sin(k.*l) .* sin(l) + cos(k.*l).*cos(l)).*(l<=2*pi-phi);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement