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

View source: R/ellipse.R

ellipseR Documentation

Returns a matrix of two columns representing x- and y-values of positions on an ellipse of horizontal axis 'a', vertical axis 'b' 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 an ellipse of horizontal axis 'a', vertical axis 'b' 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

ellipse(
  origin = c(0, 0),
  a = 2,
  b = 1,
  ang = seq(0, 2 * pi, length.out = n),
  x = NULL,
  y = NULL,
  n = 100,
  aspectcomp = FALSE
)

Arguments

origin

The origin of the ellipse.

a

The horizontal axis of the ellipse.

b

The vertical axis of the ellipse.

ang

A vector of angles defining the points on the ellipse, as seen in a polar coordinate system centered at 'origin'.

x

A vector of x-values at which the ellipse is caclulated.

y

A vector of y-values at which the ellipse is caclulated.

n

The length of 'ang' (if different from NULL) as a sequence between the first and the second element of 'ang'.

aspectcomp

Logical: If TRUE the points are attempted to be positioned evenly along the curve of the ellipse, and not by even angle increments.


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