How can I fill in the area between two intersecting circles?

I have two circles, one of radius = 2.5 centered at (0, -1), and the other of radius = 3 centered at (0, 1):
x = 0:0.01:2*pi;
y1 = plot(2.5*cos(x), 2.5*sin(x)-1, 'r');
hold on
y2 = plot(3*cos(x), 3*sin(x)+1, 'r');
I need to shade the intersection between them gray, but there's a catch; I can't use any toolboxes. So no patch or fill or area. Please help! Thanks.

3 Comments

patch(), fill() and area() are all part of basic MATLAB, not part of a toolbox. If you cannot use them, we have to ask whether you are allowed to use anything other than plot() in constructing your graphics.
Thanks! So if those aren't part of a toolbox, then how could I fill in the intersection between those two circles?
using patch(), fill(), or area() I mean

Sign in to comment.

Answers (0)

Asked:

on 9 Oct 2015

Commented:

on 9 Oct 2015

Community Treasure Hunt

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

Start Hunting!