Description Usage Arguments Value Author(s) Examples
View source: R/compute-polygon-perimeter.R
This function takes in a data frame containing one or more polygons, and computes the perimeter of each polygon
1 | compute_polygon_perimeter(vertex.df)
|
vertex.df |
A data frame where each row corresponds to the vertex of a polygon.
It must contain the columns |
A data frame that contains two columns:
group |
The group number of the polygon |
perimeter |
The perimeter of the polygon |
Mathias Isaksen mathiasleanderi@gmail.com
1 2 3 4 5 6 7 8 9 10 | # Example with multiple polygons
vertex.df = compute_regular_polygons(
center = data.frame(x = c(0, 10), y = c(0, 0)),
radius = 1,
num.edges = c(4, 1000)
)
perimeter.df = compute_polygon_perimeter(vertex.df)
# The perimeters should be around 4*sqrt(2) and 2*pi
print(perimeter.df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.