ellipse: Drawer of ellipse

View source: R/ellipse.R

ellipseR Documentation

Drawer of ellipse

Description

Draws an ellipse with independent major and minor radii.

Usage

ellipse(a, b = a, x = 0, y = 0, theta = 0, sep = 1, ...)

Arguments

a

A numeric. Radius along the major axis.

b

A numeric. Radius along the minor axis.

x

A numeric. The horizontal center of the ellipse.

y

A numeric. The vertical center of the ellipse.

theta

A numeric. The obliqueness of the ellipse in degree.

sep

A numeric. The interval of edge drawing in degree. By default 1 meaning the ellipse is actually drawn as a 360-gon (triacosiahexecontagon) because of 1-degree separation between each point.

...

Other arguments passed to graphics::polygon().

Details

Drawing of circles can be done by the combination of coordinate calculation and graphics::polygon() function. ellipse() further provides an easy way to draw an ellipse (oval circle) with independent two radii along its major and minor axes.

Value

A list. The first and second element respectively corresponds to x- and y-coodinates of the ellipse's edge.

Examples

plot(0, 0, type = "n", bty = "l",
  xlab = "x", ylab = "y",
  xlim = c(0, 100), ylim = c(0, 100))
ellipse(25, 10, 30, 20)
text(30, 20, "ellipse(25, 10, 30, 20)")
ellipse(35, 20, 60, 70, 30,
  lwd = 3, col = "gray")
text(60, 70, "ellipse(35, 20, 60, 70, 30)")


keimochizuki/htb documentation built on June 9, 2025, 10:03 p.m.