% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ellipse.R
\name{as_ellipse2d}
\alias{as_ellipse2d}
\alias{as_ellipse2d.Coord2D}
\alias{as_ellipse2d.numeric}
\title{Cast to Ellipse2D object}
\usage{
as_ellipse2d(x, ...)

\method{as_ellipse2d}{Coord2D}(x, ..., r = 0.5, rx = r, ry = r, theta = angle(0))

\method{as_ellipse2d}{numeric}(x, y = 0, ..., r = 0.5, rx = r, ry = rx, theta = angle(0))
}
\arguments{
\item{x}{Object to cast.  Either a \link{Coord2D} object of center(s) or a
numeric vector of x-coordinates of center(s).}

\item{...}{Ignored; only included for S3 method consistency.}

\item{r}{Numeric vector of (circular) radii (default \code{0.5}).}

\item{rx}{Numeric vector of x-axis semi-radii (default \code{r}).}

\item{ry}{Numeric vector of y-axis semi-radii (default \code{r}).}

\item{theta}{An \code{\link[=angle]{angle()}} vector (or numeric interpreted using the default
angular unit) of rotation angles (default \code{angle(0)}).}

\item{y}{Numeric vector of y-coordinates of center(s) (used when \code{x} is
numeric).}
}
\value{
An \link{Ellipse2D} object.
}
\description{
\code{as_ellipse2d()} casts to an \link{Ellipse2D} object.
}
\examples{
# Ellipse from Coord2D center
e <- as_ellipse2d(as_coord2d(0, 0), rx = 2, ry = 1, theta = degrees(30))
plot(e)

# Multiple ellipses
e2 <- as_ellipse2d(x = c(0, 1), y = c(0, 1), rx = c(1, 2), ry = c(0.5, 1))
plot(e2)

# Multiple circles from x, y, r vectors
c2 <- as_ellipse2d(x = c(0, 1), y = c(0, 1), rx = c(0.3, 0.4))
plot(c2)
}
