Examples for 'maptools::nearestPointOnSegment'


Get the nearest point on a segment to a given point

Aliases: nearestPointOnSegment

Keywords: spatial

### ** Examples

segment = cbind(c(1,2),c(1,1.5))
point = c(1.2,1.5)
nearestPointOnSegment(segment, point)
        X         Y  distance 
1.3600000 1.1800000 0.3577709 

[Package maptools version 1.1-4 Index]