.distancePointLine {CoreGx}R Documentation

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 = 1, b = 1, c = 0)

Arguments

x

x-coordinate of point

y

y-coordinate of point

a

numeric(1) The coefficient in line equation a * x + b * y + c = 0. Defaults to 1.

b

numeric(1) The coefficient in line equation a * x + b * y + c = 0. Defaults to 1.

c

numeric(1) The intercept in line equation a * x + b * y + c = 0. Defaults to 0.

Value

numeric The shortest distance between a point and a line.

Examples

.distancePointLine(0, 0, 1, -1, 1)


[Package CoreGx version 1.5.7 Index]