ellipse3 {aspace}R Documentation

Ellipse drawing tool

Description

A convenient tool for plotting circles or ellipses with the functionality of rotation about an angle theta (in radians). The function can also be used to capture coordinates of the perimeter of the shape for further usage outside the function.

Usage

ellipse3(cx, cy, rx, ry, theta = 0, yaxis = TRUE, pointsonly = FALSE, fill = FALSE, ...)

Arguments

cx x-coordinate of ellipse center
cy y-coordinate of ellipse center
rx radius along x-axis
ry radius along y-axis
theta rotation angle in radians from north
yaxis Depreciated. This parameter adjusts the size correct in the y- or x-axis, as plotting is generally not square. Therefore, use par(pty="s") to eliminate the need for this parameter.
pointsonly Boolean: If TRUE, ellipse will not be plotted, but rather the coordinates of the perimeter are returned in a list object for further use. The calc.sde function utilizes these coordinates to build a textfile of coordinates which the makeshapes function uses to build ESRI Shapefiles.
fill Boolean: If TRUE, the plotted ellipse will be shaded in
... Any additional parameters suitable for plotting

Details

This function plots an ellipse with center (cx, cy). The rotation angle in radians (form north) is given as theta. Note that a circle can be obtained by rx=ry, in which case theta is not very useful. Additional parameters (e.g., colour and fill density) can be provided as indicated by the '...' in the function call.

Value

This function returns a plot of an ellipse when pointsonly = FALSE. When pointsonly = TRUE, the result is a list of x,y coordinates

x A numeric vector of x-coordinates
y A numeric vector of y-coordinates

Note

This function is an an adjustment by Brad Biggerstaff (CDC) and Tarmo K. Remmel of the function circle() written by John Wallace (University of Washington) and obtained from the S-News listserv.

Author(s)

Tarmo K. Remmel

See Also

calc_sde, as_radians

Examples

  plot.new()
  plot(10,10, type="n")
  ellipse3(cx = 10, cy = 8, rx = 2, ry = 1, theta = as_radians(45), yaxis = TRUE, pointsonly = FALSE, fill = FALSE, col=6)

[Package aspace version 1.2 Index]