Re:Drawing a Washer, Polar Plot Question
- To: mathgroup at smc.vnet.net
- Subject: [mg29742] Re:[mg29728] Drawing a Washer, Polar Plot Question
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Fri, 6 Jul 2001 03:24:37 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Robert Love wanted to make a circle with a hole in it. The code almost works. radius1=3; radius2=8; step=0.1; lst=Range[0,2p,step]; pnts=Transpose[{Sin[lst],Cos[lst]}]; poly=Polygon[Join[radius1*pnts,radius2*Reverse[pnts]]]; Show[Graphics[{RGBColor[0.4,0.8,0.4],poly}],AspectRatio®Automatic]; The next version works much better. radius1=3; radius2=8; step=0.1; lst=Range[0,2p,step]; lst=Join[lst,{First[lst]}]; pnts=Transpose[{Sin[lst],Cos[lst]}]; poly=Polygon[Join[radius1*pnts,radius2*Reverse[pnts]]]; Show[Graphics[{RGBColor[0.4,0.8,0.4],poly}],AspectRatio®Automatic]; I used this in one of my MathSource packages and found that sometimes a little line comes through where the polygon wraps around on it self. That can be cured by drawing a thin rectangle on top of the thin strip. ----------- Regards, Ted Ersek Download Mathematica tips, tricks from http://www.verbeia.com/mathematica/tips/Tricks.html