Description Usage Arguments Value Examples
View source: R/CenterPolygon.R
CenterPolygon
computes the center of a polygon
1 | CenterPolygon(Poly)
|
Poly |
Polygon object, previously created with either of the functions |
Vector which contains the xy-coordinates of the center of the polygon
1 2 3 4 5 6 7 8 9 10 11 12 | P1 <- c(0,0)
P2 <- c(1,1)
P3 <- c(2,0)
Poly <- CreatePolygon(P1, P2, P3)
C <- CenterPolygon(Poly)
x_min <- -5
x_max <- 5
y_min <- -5
y_max <- 5
CoordinatePlane(x_min, x_max, y_min, y_max)
Draw(Poly, "blue")
Draw(C, "red")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.