distsegmenttopoly: Distance between a segment and a polygon

Description Usage Arguments Examples

View source: R/Distances.R

Description

Distance between a segment and a polygon

Usage

1

Arguments

s

a 2x2 numeric matrix, representing a segment. Each row of the matrix are the coordinates of a extreme point of the segment.

.poly

a polygon (a nx2 matrix, each line is a point)

Examples

1
2
3
4
5
6
zz<-function(){
.poly<-matrix(sample(0:6,6,T),3,2)[c(1:3,1),]
s<-matrix(sample(0:6,6,T),2,2)
plot(rbind(.poly,s),xlab="",yaxt="n")
points(.poly,type="l");points(s,type="l")
points(closestpointsontwopolygons(s,.poly),lty=3,col="red")}

DanielBonnery/Strategy documentation built on Dec. 17, 2021, 4:03 p.m.