midpoint_line

compas.geometry.midpoint_line(line)[source]

Compute the midpoint of a line defined by two points.

Parameters

line (2-tuple) – XYZ coordinates of the first point, and XYZ coordinates of the second point.

Returns

list – XYZ coordinates of the midpoint.

Examples

>>> midpoint_line(([0.0, 0.0, 0.0], [1.0, 0.0, 1.0]))
[0.5, 0.0, 0.5]