Question: How to Shade an Annular Region

In trying to create a plot that shades the region between two concentric circles, I decided to try using the Picture procedure found here: https://www.mapleprimes.com/posts/145922-Perimeter-Area-And-Visualization-Of-A-Plane-Figure-

This is as far as I got.


 

"Picture := proc (L, C, N::posint := 100, Boundary::list := [linestyle = 1])    local i, var, var1, var2, e, e1, e2, P, Q, h;    global Border;    for i to nops(L) do    if type(L[i], listlist(algebraic)) then P[i] := op(L[i]) else    var := lhs(L[i, 2]); var1 := lhs(rhs(L[i, 2])); var2 := rhs(rhs(L[i, 2])); h := (var2-var1)/N;    if type(L[i, 1], algebraic) then e := L[i, 1];    if nops(L[i]) = 3 then P[i] := seq(subs(var = var1+h*i, [e*cos(var), e*sin(var)]), i = 0 .. N) else    P[i] := seq([var1+h*i, subs(var = var1+h*i, e)], i = 0 .. N) end if else    e1 := L[i, 1, 1]; e2 := L[i, 1, 2]; P[i] := seq(subs(var = var1+h*i, [e1, e2]), i = 0 .. N) end if end if    end do;    Q := [seq(P[i], i = 1 .. nops(L))];    Border := plottools[curve]([op(Q), Q[1]], op(Boundary));    [plottools[polygon](Q, C), Border];    end proc:"

L := [[3, t = 0 .. 2*Pi, polar], [2, t = 0 .. 2*Pi, polar]]; plots[display](Picture(L, color = yellow, [color = brown, thickness = 3]), scaling = constrained, view = [-4 .. 4, -4 .. 4])

 

NULL


Clearly, this is not what I want. I am probably missing something simple here. How can I get only the region between the two circles to be shaded?

Download shading_annular_regions.mw

 

 

 

Please Wait...