Point.on_segment

Point.on_segment(segment, tol=None)[source]

Determine if the point lies on the given segment.

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

The segment.

tolfloat, optional

A tolerance value for the distance between the point and the segment. Default is TOL.absolute.

Returns:
bool

True, if the point lies on the segment. False, otherwise.

Examples

>>> from compas.geometry import Line
>>> line = Line(Point(1.0, 0.0, 0.0), Point(1.0, 1.0, 0.0))
>>> point = line.point_at(1.5)
>>> point.on_segment(line)
False