Advertisement
dmkozyrev

lemn.m

May 27th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. function lemn(n)
  2.   if (n <= 0), n = 24; end;
  3.   colors = 'mcrgb';  
  4.   for k = 0:n-1
  5.     plot_one(k * pi / n, colors(mod(k, length(colors)) + 1));
  6.     pause(0.05);
  7.   end
  8. end
  9.  
  10. function plot_one(dfi, color)
  11.   fi = -pi/4:pi/200:pi/4;
  12.   ro = sqrt(2*cos(2*fi));
  13.   polar(fi+dfi,ro,color);
  14.   hold on;
  15.   polar(fi+dfi,-ro,color);
  16.   grid on;
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement