ShortestDistance: Distance between a point and a line

View source: R/Utility.R

ShortestDistanceR Documentation

Distance between a point and a line

Description

Computes the Euclidean distance between a point and the line through two points (used by DouglasPeucker).

Usage

ShortestDistance(p, line)

Arguments

p

A vector with the coordinates of the point.

line

A 2 x 2 matrix with the coordinates of two points of the line.

Value

A number, the distance of p from line.

See Also

DouglasPeucker

Examples

ShortestDistance(c(0, 1), rbind(c(0, 0), c(1, 0)))

HistDAWass documentation built on Oct. 29, 2026, 5:07 p.m.