closest_point_on_segment_xy

compas.geometry.closest_point_on_segment_xy(point, segment)[source]

Compute closest point on a line segment to a given point lying in the XY-plane.

Parameters:
point[float, float] or [float, float, float] | compas.geometry.Point

XY(Z) coordinates of a point.

segment[point, point] | compas.geometry.Line

Two 2D or 3D points defining the line segment (Z components will be ignored).

Returns:
[float, float, 0.0]

XYZ coordinates of closest point in the XY plane.