% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{generate_ellipse_path}
\alias{generate_ellipse_path}
\title{Generate Ellipse Path}
\usage{
generate_ellipse_path(x0 = 0, y0 = 0, a = 2, b = 1, angle = 0, density = 200)
}
\arguments{
\item{x0}{The coordinate x of the polygon center point (default: 0).}

\item{y0}{The coordinate y of the polygon center point (default: 0).}

\item{a}{Long arm (default: 2).}

\item{b}{Short arm (default: 1).}

\item{angle}{Rotation angle in degree (default: 0).}

\item{density}{Greater amount of points yield smoother ellipse (default: 200).}
}
\value{
A data.frame with the point coordinates (x, y) to construct the polygon
}
\description{
Generate Ellipse Path
}
\examples{
library(ggplot2)
# Draw a circle
circle <- generate_ellipse_path(a = 1, b = 1)
ggplot(circle, aes(x, y)) +
    geom_polygon() +
    coord_fixed()
# Draw an ellipse
ellipse <- generate_ellipse_path(a = 2, b = 1, angle = 45)
ggplot(ellipse, aes(x, y)) +
    geom_polygon() +
    coord_fixed()
}
