distance_point_line

compas.geometry.distance_point_line(point, line)[source]

Compute the distance between a point and a line.

Parameters
  • point ([float, float, float] | Point) – Point location.

  • line ([point, point] | Line) – Line defined by two points.

Returns

float – The distance between the point and the line.

Notes

This implementation computes the right angle distance from a point P to a line defined by points A and B as twice the area of the triangle ABP divided by the length of AB 1.

References

1

Wikipedia. Distance from a point to a line. Available at: https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line

Examples

>>>