expandpoly {pgirmess}R Documentation

Homothetia (size expansion) of a polygon

Description

Compute the new coordinates of polygon expanded by a factor.

Usage

expandpoly(mypol, fact)

Arguments

mypol matrix or data.frame of polygon coordinates
fact expansion factor (eg 2 = 2 times, 0.5 = half, etc...)

Value

A matrix of polygon coordinates

Author(s)

Patrick Giraudoux <pgiraudo@univ-fcomte.fr>

See Also

polygon

Examples


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")


[Package pgirmess version 1.3.8 Index]