MATLAB: Fill area between two polar curves

patch between polar curves

Hello , i have these two formulas, i would like to fill the area between these two curves is there a way to do it with patch command?
Thanks
phi=0.87*sin((log(r)*pi)/(log(tau)));
phi_shifted_45=0.87*sin((log(r)*pi)/(log(tau)))+0.78;

Best Answer

The patch function will not work with polar axes. It throws this error:
Error using patch
While setting property 'Parent' of class 'Patch':
Patch cannot be a child of PolarAxes.
Oh, well...
The best I can do with this is to use pol2cart:
tau = 0.5;
r = linspace(eps, 1.5, 500);
phi = 0.87*sin((log(r)*pi)/(log(tau)));
phi_shifted_45 = 0.87*sin((log(r)*pi)/(log(tau)))+0.78;
[x1,y1] = pol2cart(phi, r);
[x2,y2] = pol2cart(phi_shifted_45, r);
figure(1)
patch([x1 fliplr(x2)], [y1 fliplr(y2)], 'g')
axis equal
Note to MathWorks: Can we have a patch for polar coordinate systems when you have time to implement it?