% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/regular_ngon_polygon2d.R
\name{regular_ngon_polygon2d}
\alias{regular_ngon_polygon2d}
\title{Regular n-gon polygon}
\usage{
regular_ngon_polygon2d(n, x = 0, y = 0, radius = 0.5, theta = degrees(90))
}
\arguments{
\item{n}{Number of vertices.}

\item{x}{X-coordinate of the center (default \code{0}).}

\item{y}{Y-coordinate of the center (default \code{0}).}

\item{radius}{Circumradius: distance from center to each vertex
(default \code{0.5}).}

\item{theta}{Angle of the first vertex (default \code{degrees(90)}).
Will be coerced by \code{\link[=degrees]{degrees()}}.}
}
\value{
A \link{Polygon2D} object with \verb{$is_convex == TRUE}.
}
\description{
\code{regular_ngon_polygon2d()} creates a regular n-gon \link{Polygon2D} object
centered at \verb{(x, y)} with circumradius \code{radius}.
}
\examples{
# A regular hexagon
p <- regular_ngon_polygon2d(6)
p$is_convex
plot(p)
}
\seealso{
\code{\link[=isotoxal_2ngon_polygon2d]{isotoxal_2ngon_polygon2d()}} for isotoxal star polygons.
\code{\link[=rectangle_polygon2d]{rectangle_polygon2d()}} for rectangles.
}
