pointOnSegment: Snap a points to a segment

pointOnSegmentR Documentation

Snap a points to a segment

Description

This function snaps a point to a segment based on the minimum distance between the point and the segment

Usage

pointOnSegment(s, p)

Arguments

s

[2,2] matrix giving the coordinates of the line, one point per row

p

2-length vector repsenting the point

Value

A 4-length vector, with 'x','y' [coordinates of the point snapped to the segment], 'd' [distance from the input point to the new snapped point], and 'chain' [distance from the starting of the segment to the snapped point]

Author(s)

Javier Garcia-Pintado

See Also

Spatial-class


SpatialGraph documentation built on Sept. 28, 2023, 5:08 p.m.