Learn R Programming

spatstat.geom (version 3.6-1)

ellipse: Elliptical Window.

Description

Create an elliptical window.

Usage

ellipse(a, b, centre=c(0,0), phi=0, ..., mask=FALSE, npoly = 128)

Arguments

Value

An object of class owin (either of type “polygonal”

or of type “mask”) specifying an elliptical window.

Details

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.

See Also

disc, owin.object, owin, as.mask

Examples

Run this code
  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)

Run the code above in your browser using DataLab