DistancePointLine {LearnGeom} | R Documentation |
DistancePointLine
computes the distance between a point and a line
DistancePointLine(P, Line)
P |
Vector containing the xy-coordinates of a point |
Line |
Vector object previously created with |
Returns the distance between a point and a line. This distance corresponds to the distance between the point and its orthogonal projection into the line
P <- c(2,1)
P1 <- c(0,0)
P2 <- c(1,1)
Line <- CreateLinePoints(P1, P2)
d <- DistancePointLine(P, Line)