[R] monte carlo method for circle area

white.denis@epamail.epa.gov white.denis at epamail.epa.gov
Mon Mar 31 22:04:48 CEST 2003


You can look at the function ngon in package maptree to see how to
generate a polygon definition of a circle (to whatever resolution you
want).  Then you can use the polygon clipping functions in gpclib to
clip your points to a circle.

> I ve got an assignment which consists in calculating the area of
> a circle given  a certain radius and center using the monte carlo
> method, which means that I have to plot a circle given its parameters.
> Limit the area inside it...with as many sample points as possible...
> and all of this inside a nxn size window, which could be 1x1, or any
> size actually. I wonder how I could just limit the area inside the
> circle..that would be great help for me. Some of you have given me
> several suggestions about plotting a circle using some built-in
> functions but I wonder if its suits my problem since I have to
> somehow limit the circles inner area.



More information about the R-help mailing list