expandpoly | R Documentation |
Compute the new coordinates of polygon expanded by a factor.
expandpoly(mypol, fact)
mypol |
matrix or data.frame of polygon coordinates |
fact |
expansion factor |
The polygon area obtained after expansion is equal to fact^2
times the original polygon area
A matrix of polygon coordinates
polygon
x<-c(-5,-4.5,0,10,5)
y<-c(-10,0,5,5,-8)
poly<-cbind(x,y)
plot(-10:20,-20:10,type="n")
polygon(poly)
polygon(expandpoly(poly,1.5),border="red")
polygon(expandpoly(poly,0.5),border="blue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.