2
$\begingroup$

I am trying to plot two circles with radius 1 and another with radius 9. Both are centered at $(0,-1)$. I then want to color in the distance between the circle of radius 9 and the circle of radius 1.

Plot[Graphics[{Blue, Circle[{0, -1}, 9]}] Graphics[{Blue, Dashed, 
Circle[{0, -1}, 1]}], {x, -10, 10}, {y, -10, 10}]

I have the above, but it is wrong. I would like a graph of both with axes.

I am really trying to plot the region in the complex plane from $1< \mid(z+i)\mid \le3$, which I determined to be the two circle from above.

$\endgroup$
  • $\begingroup$ What do you mean by "want to color in the distance"? $\endgroup$ – Dr. belisarius Sep 17 '15 at 14:57
  • $\begingroup$ So color the region from circle with radius 1 to circle with radius 9. Essentially forming a disc $\endgroup$ – Jack Armstrong Sep 17 '15 at 14:59
  • 1
    $\begingroup$ Graphics[{Green, Disk[{0, -1}, 9], White, Disk[{0, -1}, 1]}, Axes -> True] $\endgroup$ – Dr. belisarius Sep 17 '15 at 15:01
  • 1
    $\begingroup$ Following the code in the question the answer-comment above can be modified as: Graphics[{Green, EdgeForm[{Thick, Blue}], Disk[{0, -1}, 9], EdgeForm[{Thick, Blue, Dashed}], White, Disk[{0, -1}, 1]}, Frame -> True] $\endgroup$ – Anton Antonov Sep 17 '15 at 15:07
4
$\begingroup$

With borders:

Graphics[{LightBlue, Disk[{0, -1}, 9], Blue, Circle[{0, -1}, 9], 
  Dashed, Thick, Circle[{0, -1}, 1], White, Disk[{0, -1}, 1]}, 
 Axes -> True]

enter image description here

$\endgroup$
5
$\begingroup$

Using Region objects is overkill if your problem only entails drawing out these circles, but if you want to do further calculations with them, the approach might still interest you. Besides, it quite directly translates your question about the difference of two geometric regions into the MMA language.

DiscretizeRegion[
 RegionDifference[Disk[{0, -1}, 9], Disk[{0, -1}, 1]],
 MaxCellMeasure -> 0.01, PlotTheme -> "Polygons", Axes -> True
]

Mathematica graphics

The RegionDifference region is now a fully computable geometric region, i.e. for instance you could use it as an integration domain, to solve differential equations, etc. See for instance: Derived Regions.

$\endgroup$
  • $\begingroup$ I like this a lot more. It helps if I were to do so much more with this problem. Thank you. $\endgroup$ – Jack Armstrong Sep 17 '15 at 15:45
3
$\begingroup$

Just for Fun.

The equation for a Circle with center at the origin would be

circle = r^2 == x^2 + y^2

And we can use this knowledge to plot a circle with Radius r

r = 1;
RegionPlot[r^2 > x^2 + y^2, {x, -2, 2}, {y, -2, 2}]

enter image description here

The equation for a Circle from the origin shifted would be

circleShifted = r^2 == (x - a)^2 + (y - b)^2

and with the Parameters given

r1 = 1; r2 = 9;
{a, b} = {0, -1};

we can plot the desired Function

RegionPlot[{r1^2 < (-a + x)^2 + (-b + y)^2 < r2^2}, 
{x, -12, 12}, {y, -12, 12}, Axes -> True, BoundaryStyle -> Red, 
PlotStyle -> {Blue}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.