Learn R Programming

CoreGx (version 0.1.1)

distancePointLine: Calculate shortest distance between point and line

Description

This function calculates the shortest distance between a point and a line in 2D space.

Usage

distancePointLine(x, y, a, b, c)

Arguments

x

x-coordinate of point

y

y-coordinate of point

a

coefficient in line equation a * x + b * y + c = 0

b

coefficient in line equation a * x + b * y + c = 0

c

coefficient in line equation a * x + b * y + c = 0

Examples

Run this code
# NOT RUN {
distancePointLine(0, 0, 1, -1, 1)

# }

Run the code above in your browser using DataLab