# How to make a dynamic plot of a holed circle using "Manipulate"

I would like to make a dynamic circle with the inner radius ($$R_a(t)$$) moving to $$R_b$$ like the image below. I had difficulty using Manipulate and leaving the intersections colored as in the image. Would anyone know how to do it that way?

Thank you very much for your attention!

• Can you show us the code you've tried so far? Oct 15, 2021 at 0:58
• Welcome to MMA SE! as already requested, in general please post the code you've tried so far so others can copy-and-paste and fiddle with it. You might find it useful to construct this as three Disks of decreasing radius stacked one on top of the other, or as two Annuluses. Oct 15, 2021 at 1:06
• Excellent question applicable to many industries such as oil/gas, EM, transmission lines, and all the STEM fields really. I request that you modify your title to help search engines so as to bring more visitors to this page. The word "graph" has a different usage in Math/CS.
– Syed
Oct 15, 2021 at 7:28

{minradiusa, radiusb, radiusr} = {.2, .85, 1};


Labeled arrow annotations:

labeledArrows[r_] := {PointSize[Medium], Point[{0, 0}],
{Automatic, .5, Graphics[{Text[Style[#, 16], {0, 0}, {0, -1.2}, #2]}]}}],
Arrow[{{0, 0}, #3 {Cos[#4 Pi/4], Sin[#4 Pi/4]}}]} &,
{{#<>"(t)", ##2}& @@ (ToString[Subscript[R, #], StandardForm] & /@ {"a", "r", "b"}),
{{-1, 0}, {1, 0}, {1, 0}},
{5, 1, 7}}]}

Graphics @ labeledArrows[.5]


Animate + Graphics:

Alternatively, use Annulus + Graphics + Animate:

Animate[Graphics[{EdgeForm[Gray],
Opacity[1], Black, labeledArrows[rt]},
PlotLabel -> Style[PromptForm[Area,
Pane[Round[ Pi (radiusb^2 - rt^2), .001], ImageSize -> {50, 20}]], 16, Black]],


Animation without controls:

frames = Table[Graphics[{EdgeForm[Gray], LightYellow,
Opacity[1], Black, labeledArrows[rt]},
PlotLabel -> Style[PromptForm[Area,
Pane[Round[ Pi (radiusb^2 - rt^2), .001], ImageSize -> {50, 20}]], 16, Black]],



Manipulate + ParametricPlot

Use ParametricPlot with the options MeshFunctions, Mesh and MeshShading, and use labeledArrows[] as Epilog. Dynamically control first element of the mesh values using Manipulate:

Manipulate[
ParametricPlot[
r { Cos @ t,  Sin @ t}, {t, 0 , 2 Pi}, {r, minradiusa, 1},
MeshFunctions -> {#4 &},
MeshStyle -> Thick,
Epilog -> labeledArrows[rt],
PerformanceGoal -> "Quality",
PlotPoints -> 90,
BoundaryStyle -> None,
Frame -> False, Axes -> False,
ImageSize -> 600
PlotLabel -> Style[PromptForm[Area,
Pane[Round[ Pi (radiusb^2 - rt^2), .001], ImageSize -> {50, 20}]], 16, Black]],
{{rt, .3, Style[ToString[Subscript[R, a], StandardForm] <> "(t)", 14]},
.2, .85, Appearance -> "Open"}]


• thank you very much! Can i save an animate video without the "manipulation controls" at the top? Oct 15, 2021 at 1:47
• @Felipe, please see the update.
– kglr
Oct 15, 2021 at 1:55

A starting point.

annulus = RegionDifference[Disk[{0, 0}, 2.3], Disk[{0, 0}, 2]];
regint[r_] := RegionDifference[Disk[{0, 0}, 2.3], Disk[{0, 0}, r]];
ani = Animate[
Show[Region[regint[r],
BaseStyle -> {Blend[{LightYellow, Orange}, .15],
EdgeForm[Directive[Thick, Black]]}],
Region[annulus,
BaseStyle -> {Gray, EdgeForm[Directive[Thick, Black]]}],
PlotLabel -> "Area = " <> ToString[RegionMeasure@regint[r]]], {r,
1, 2}]
Export["test.gif", ani, "ControlAppearance" -> None,
"AnimationRepetitions" -> Infinity, ImageSize -> Large]

(* Export["test.mp4", ani, "ControlAppearance" -> None, FrameRate -> 20,
"AnimationDuration" -> 10, ImageSize -> Large] *)