| disc {spatstat} | R Documentation | 
Creates a circular window
disc(radius=1, centre=c(0,0), ..., mask=FALSE, npoly=128)
radius | 
Radius of the circle. | 
centre | 
Coordinates of the centre of the circle. | 
mask | 
Logical flag controlling the type of approximation to a perfect circle. See Details. | 
npoly | 
Number of edges of the polygonal approximation,
if mask=FALSE.
 | 
... | 
Arguments passed to as.mask determining the
pixel resolution, if mask=TRUE.
 | 
This command creates a window object representing a disc, with the given radius and centre.
By default, the circle is
approximated by a polygon with npoly edges.
If mask=TRUE, then the disc is approximated by a binary pixel
mask. The resolution of the mask is controlled by
the arguments ... which are passed to as.mask.
An object of class "owin" (see owin.object)
specifying a window.
This function can also be used to generate regular polygons,
by setting npoly to a small integer value. For example
npoly=5 generates a pentagon and npoly=13 a triskaidecagon.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
# unit disc W <- disc() # disc of radius 3 centred at x=10, y=5 W <- disc(3, c(10,5)) # plot(disc()) plot(disc(mask=TRUE)) # nice smooth circle plot(disc(npoly=256)) # how to control the resolution of the mask plot(disc(mask=TRUE, dimyx=256)) # check accuracy of approximation area.owin(disc())/pi area.owin(disc(mask=TRUE))/pi