% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/isotoxal_2ngon_polygon2d.R
\name{isotoxal_2ngon_polygon2d}
\alias{isotoxal_2ngon_polygon2d}
\alias{star_polygon2d}
\title{Isotoxal \verb{2n}-gon and star polygon}
\usage{
isotoxal_2ngon_polygon2d(
  n,
  x = 0,
  y = 0,
  radius = 0.5,
  radial_scale = isotoxal_2ngon_inner_radius(n, alpha = alpha, beta_ext = beta_ext, d =
    d),
  theta = degrees(90),
  ...,
  alpha = NULL,
  beta_ext = NULL,
  d = NULL
)

star_polygon2d(
  n,
  x = 0,
  y = 0,
  radius = 0.5,
  radial_scale = isotoxal_2ngon_inner_radius(n, alpha = alpha, beta_ext = beta_ext, d =
    d),
  theta = degrees(90),
  ...,
  alpha = NULL,
  beta_ext = NULL,
  d = NULL
)
}
\arguments{
\item{n}{Number of outer vertices.}

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

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

\item{radius}{Outer circumradius (default \code{0.5}).}

\item{radial_scale}{Inner radius as a fraction of \code{radius}.  Defaults to
\code{isotoxal_2ngon_inner_radius(n, alpha = alpha, beta_ext = beta_ext, d = d)}.
Exactly one of \code{radial_scale}, \code{alpha}, \code{beta_ext}, or \code{d} must be
supplied.}

\item{theta}{Angle of the first outer vertex (default \code{degrees(90)}).
Will be coerced by \code{\link[=degrees]{degrees()}}.}

\item{...}{Ignored.}

\item{alpha}{Interior angle of an outer vertex.  Will be coerced by
\code{\link[=degrees]{degrees()}}.}

\item{beta_ext}{Exterior angle of an inner vertex.  Will be coerced by
\code{\link[=degrees]{degrees()}}.}

\item{d}{Density (winding number) of the star polygon \verb{|n/d|}.}
}
\value{
A \link{Polygon2D} object.
}
\description{
\code{isotoxal_2ngon_polygon2d()} creates an isotoxal \verb{2n}-gon \link{Polygon2D}
object centered at \verb{(x, y)}.
\code{star_polygon2d()} is an alias.
}
\details{
Isotoxal \verb{2n}-gon polygons have \verb{2n} vertices alternating between \code{n}
outer vertices on a circle of radius \code{radius} and \code{n} inner vertices on
a concentric circle of radius \code{radial_scale * radius}.
}
\examples{
# |5/2| star (the verda stelo)
p <- isotoxal_2ngon_polygon2d(5, d = 2)
p$is_convex
plot(p, col = "#008000", border = NA)

# `star_polygon2d()` is an alias
p2 <- star_polygon2d(5, d = 2)
all.equal(p, p2)
}
\seealso{
\code{\link[=isotoxal_2ngon_inner_radius]{isotoxal_2ngon_inner_radius()}} to compute the radial scale.
\code{\link[=rectangle_polygon2d]{rectangle_polygon2d()}} for rectangles.
\code{\link[=regular_ngon_polygon2d]{regular_ngon_polygon2d()}} for regular convex polygons.
\url{https://en.wikipedia.org/wiki/Isotoxal_figure#Isotoxal_polygons} and
\url{https://en.wikipedia.org/wiki/Star_polygon#Isotoxal_star_simple_polygons}
for more information on isotoxal polygons.
}
