Colouring between curves and cutting curves

1 view (last 30 days)
Hi, I have made this in Matlab:
Now i want to colour the region inside the circle and outside the blue curve. After i want to cut the curves so only the coloured section will be remaining. Is there a way to do this? thanks!
I'm adding my code:
t=0:0.01:2*pi;
r=2*sin(t).*cos(t).*cos(t);
r2=sin(t);
figure
hold on
grid on
polar(t,r);
polar(t,r2);
hold off
legend('r=2sin(t)cos^2(t)','r=sint(t)');
title('Esquisse de C et de r=sin(t)');
  2 Comments
jgg
jgg on 21 Jan 2016
Can you post your code? You'll probably want to use fill with your points defined by the red and blue curves between -0.5 and +0.5, which probably has a convenient polar representation.
Star Strider
Star Strider on 21 Jan 2016
It would likely be easiest to use the patch function, but ‘easy’ is relative. Another possibility is the area function. I don’t know which would be most appropriate here.

Sign in to comment.

Answers (0)

Categories

Find more on Polar Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!