powered by
This function calculates the shortest distance between a point and a line in 2D space.
distancePointLine(x, y, a, b, c)
x-coordinate of point
y-coordinate of point
coefficient in line equation a * x + b * y + c = 0
# NOT RUN { distancePointLine(0, 0, 1, -1, 1) # }
Run the code above in your browser using DataLab