R/assertPolygon.R

Defines functions assertPolygon

assertPolygon=function(Polygon,Eps=1e-03){
  #make sure the polygon is closed except of epsilon
  Diff=abs(head(Polygon,1)-tail(Polygon,1))
  if(any(Diff>Eps))
    Polygon=rbind(Polygon,head(Polygon,1)+c(Eps,-Eps))
  
  return(Polygon)
}

Try the ScatterDensity package in your browser

Any scripts or data that you put into this service are public.

ScatterDensity documentation built on April 15, 2025, 5:09 p.m.