Skip to contents

isotoxal_2ngon_polygon2d() creates an isotoxal 2n-gon Polygon2D object centered at (x, y). star_polygon2d() is an alias.

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

n

Number of outer vertices.

x

X-coordinate of the center (default 0).

y

Y-coordinate of the center (default 0).

radius

Outer circumradius (default 0.5).

radial_scale

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

theta

Angle of the first outer vertex (default degrees(90)). Will be coerced by degrees().

...

Ignored.

alpha

Interior angle of an outer vertex. Will be coerced by degrees().

beta_ext

Exterior angle of an inner vertex. Will be coerced by degrees().

d

Density (winding number) of the star polygon |n/d|.

Value

A Polygon2D object.

Details

Isotoxal 2n-gon polygons have 2n vertices alternating between n outer vertices on a circle of radius radius and n inner vertices on a concentric circle of radius radial_scale * radius.

Examples

# |5/2| star (the verda stelo)
p <- isotoxal_2ngon_polygon2d(5, d = 2)
p$is_convex
#> [1] FALSE
plot(p, col = "#008000", border = NA)


# `star_polygon2d()` is an alias
p2 <- star_polygon2d(5, d = 2)
all.equal(p, p2)
#> [1] TRUE