perimeter | R Documentation |
Calculates the perimeter of a 2D shape.
perimeter(data, keep_data = FALSE)
data |
A data frame with the first two columns ordered x and y coordinates. |
keep_data |
Logical. Keep lengths of all segments of the perimeter? Defaults to FALSE. |
The perimeter.
mcap_2d <- mesh_to_2d(mcap)
plot(mcap_2d)
perimeter(mcap_2d)
r <- 1 # radius
circ <- sim_circle(r=r) # simulate xy coordinates for a circle of radius 1
plot(circ, asp=1)
perimeter(circ)
2 * pi * r # Note xy resolution affects output
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.