Return circumference length of polygon line

circumference(l.)

Arguments

l.

data frame of line coordinates (x,y)

Value

a numeric of circumference length of polygon line

Examples

l. <- data.frame(x=c(0,0,1,1),y=c(0,1,1,0))
plot(l.,type="b") ; polygon(l.)

circumference(l.)
#> [1] 4