Learn R Programming

spatstat.geom (version 3.7-0)

regularpolygon: Create A Regular Polygon

Description

Create a window object representing a regular (equal-sided) polygon.

Usage

regularpolygon(n, edge = 1, centre = c(0, 0), ...,
               align = c("bottom", "top", "left", "right", "no"))

hexagon(edge = 1, centre = c(0,0), ..., align = c("bottom", "top", "left", "right", "no"))

Arguments

Value

A window (object of class "owin").

Details

The function regularpolygon creates a regular (equal-sided) polygon with n sides, centred at centre, with sides of equal length edge. The function hexagon is the special case n=6.

The orientation of the polygon is determined by the argument align. If align="no", one vertex of the polygon is placed on the \(x\)-axis. Otherwise, an edge of the polygon is aligned with one side of the frame, specified by the value of align.

See Also

disc, ellipse, owin.

hextess for hexagonal tessellations.

Examples

Run this code
  plot(hexagon())
  plot(regularpolygon(7))
  plot(regularpolygon(7, align="left"))

Run the code above in your browser using DataLab