MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re:Drawing a Washer, Polar Plot Question


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




  • Prev by Date: Re: proof by induction?
  • Next by Date: Re: List-Operations on Heads other than List
  • Previous by thread: RE: Drawing a Washer, Polar Plot Question
  • Next by thread: RE Map