ellipse | R Documentation |
Create an elliptical window.
ellipse(a, b, centre=c(0,0), phi=0, ..., mask=FALSE, npoly = 128)
a , b |
The half-lengths of the axes of the ellipse. |
centre |
The centre of the ellipse. |
phi |
The (anti-clockwise) angle through which the ellipse should be
rotated (about its centre) starting from an orientation in which
the axis of half-length |
mask |
Logical value controlling the type of approximation to a perfect ellipse. See Details. |
... |
Arguments passed to |
npoly |
The number of edges in the polygonal approximation to the ellipse. |
This command creates a window object representing an ellipse with the given centre and axes.
By default, the ellipse is
approximated by a polygon with npoly
edges.
If mask=TRUE
, then the ellipse is approximated by a binary pixel
mask. The resolution of the mask is controlled by
the arguments ...
which are passed to as.mask
.
The arguments a
and b
must be single positive numbers.
The argument centre
specifies the ellipse centre: it can be either
a numeric vector of length 2 giving the coordinates,
or a list(x,y)
giving the coordinates of exactly one point, or a
point pattern (object of class "ppp"
) containing exactly one point.
An object of class owin
(either of type “polygonal”
or of type “mask”) specifying an elliptical window.
and \rolf.
disc
,
owin.object
,
owin
,
as.mask
W <- ellipse(a=5,b=2,centre=c(5,1),phi=pi/6)
plot(W,lwd=2,border="red")
WM <- ellipse(a=5,b=2,centre=c(5,1),phi=pi/6,mask=TRUE,dimyx=64)
plot(WM,add=TRUE,box=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.