ngon: Outline or Fill a Regular Polygon

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Draws a regular polygon at specified coordinates as an outline or shaded.

Usage

1
  ngon (xydc, n=4, angle=0, type=1)

Arguments

xydc

four element vector with x and y coordinates of center, d diameter in mm, and c color.

n

number of sides for polygon (>8 => circle).

angle

rotation angle of figure, in degrees.

type

type=1 => interior filled, type=2 => edge, type=3 => both.

Details

Uses polygon to draw shaded polygons and lines for outline. If n is odd, there is a vertex at (0, d/2), otherwise the midpoint of a side is at (0, d/2).

Value

Invisible.

Author(s)

Denis White

See Also

polygon, lines, map.key, map.groups

Examples

1
2
3
  plot (c(0,1), c(0,1), type="n")
  ngon (c(.5, .5, 10, "blue"), angle=30, n=3)
  apply (cbind (runif(8), runif(8), 6, 2), 1, ngon)

Example output

Loading required package: cluster
Loading required package: rpart
NULL

maptree documentation built on May 2, 2019, 7:24 a.m.

Related to ngon in maptree...