Calculates the perimeter of a 2D shape.
Examples
mcap_2d <- mesh_to_2d(mcap)
plot(mcap_2d)
perimeter(mcap_2d)
#> [1] 1.678564
r <- 1 # radius
circ <- sim_circle(r=r) # simulate xy coordinates for a circle of radius 1
plot(circ, asp=1)
perimeter(circ)
#> [1] 6.282131
2 * pi * r # Note xy resolution affects output
#> [1] 6.283185