CreateRegularPolygon: Creates a matrix to represent a regular polygon

Description Usage Arguments Value Examples

View source: R/CreateRegularPolygon.R

Description

CreateRegularPolygon creates a matrix to represent the polygon that connects several points

Usage

1

Arguments

n

Number of sides for the polygon

C

Vector containing the xy-coordinates for the center of the regular polygon

l

Length of the sides for the polygon

Value

Returns a matrix which contains the points of a regular polygon given its number of points and the length of its sides. Each row represents one of the points

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x_min <- -5
x_max <- 5
y_min <- -5
y_max <- 5
CoordinatePlane(x_min, x_max, y_min, y_max)
n <- 5
C <- c(0,0) 
l <- 1
Penta <- CreateRegularPolygon(n, C, l)
Draw(Penta, "blue", label = TRUE)

Example output


LearnGeom documentation built on July 14, 2020, 5:06 p.m.