Point.on_segment

Point.on_segment(segment)[source]

Determine if the point lies on the given segment.

Parameters

segment ([point, point] | compas.geometry.Line) – The segment.

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(1.5)
>>> point.on_segment(line)
False