% Examples of a 2d curves in polar coordinates: % USAGE: CUT and PASTE into MATLAB command line. figure(1); clf; subplot(2,2,1); q = [0:pi/100:2*pi]; %%%% cardioid r = 6-6sin(q) %%%%% r = 6-6.*sin(q); plot(r.*cos(q),r.*sin(q),'b-'); subplot(2,2,2); polar(q,6-6.*sin(q),'b-'); %%%% lemnicate r=sqrt(9cos(2q)) %%%% q = [-pi/2:pi/100:pi/2]; r=sqrt(9.*cos(2.*q)); subplot(2,2,3); plot(r.*cos(q),r.*sin(q),'r-'); hold; plot(-r.*cos(q),-r.*sin(q),'r-'); subplot(2,2,4); polar(q,sqrt(9.*cos(2.*q)),'r-'); hold; polar(q,-sqrt(9.*cos(2.*q)),'r-');