circle: Plot a Circle or Regular Polygon

Description Usage Arguments Value Author(s) See Also

View source: R/circle.R

Description

Plot a circle or regular polygon of a given radius at a given location.

Usage

1
circle(x, y = 0, add = T, segs = 100, how = "radius", ...)

Arguments

x

A numeric vector of length 1 or 2:

  • If length(x)==1: origin is assumed to be c(0,0); x-coordinate of a radial segment.

  • If length(x)==2: x-coordinates of origin (x[1]) and radius endpoint.

y

Optional numeric vector of length 1 or 2:

  • If omitted: assume y-coordinates of zero.

  • If length(y)==1: origin is assumed to be c(0,0); y-coordinate of a radial segment.

  • If length(y)==2: y-coordinates of origin (x[1]) and radius endpoint.

add

Logical value indicating whether circle should be added to an existing plot (default) or to a new plot.

segs

Integer; number of segments used to approximate a circle. A small number will produce a regular polygon inscribed within the radius, with a vertex at x, y

how

Character string specifying how x and y relate to the circle geometry. Currently only radius is implemented.

...

Other named arguments passed to lines or plot (such as lwd, lty, col, etc.)

Value

Returns a data.frame with columns x and y specifying coordinates of the vertices.

Author(s)

M.W.Rowe, mwr.stats@gmail.com

See Also

par and plot.default give more detailed descriptions of the ... plotting parameters.


mwrowe/microRutils documentation built on June 12, 2021, 2:41 p.m.