circle: Returns a matrix of two columns representing x- and y-values...

View source: R/circle.R

circleR Documentation

Returns a matrix of two columns representing x- and y-values of positions on a circle of radius 'r' and origin 'origin', defined by the angles given by 'ang' in a polar coordinate system centered at 'origin', or by 'x' or 'y' in a cartesian coordinate system.

Description

Returns a matrix of two columns representing x- and y-values of positions on a circle of radius 'r' and origin 'origin', defined by the angles given by 'ang' in a polar coordinate system centered at 'origin', or by 'x' or 'y' in a cartesian coordinate system.

Usage

circle(
  origin = c(0, 0),
  r = 1,
  ang = seq(0, 2 * pi, length.out = 100),
  x = NULL,
  y = NULL,
  n = 100
)

Arguments

origin

is the origin of the circle.

r

is the radius of the circle, possibly a vector of the same length as 'ang' for varying radius.

ang

is a vector of angles defining the point on the circle, as seen in a polar coordinate system centered at 'origin'.

x

is a vector of x-values at which the circle is caclulated.

y

is a vector of y-values at which the circle is caclulated.

n

is (if length(and)==2) the length of 'ang' as a sequence between its first and the second element.


arnejohannesholmin/sonR documentation built on April 14, 2024, 11:39 p.m.