midpoint_line

compas.geometry.midpoint_line(line)[source]

Compute the midpoint of a line defined by two points.

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

XYZ coordinates of the first point, and XYZ coordinates of the second point.

Returns:
[float, float, float]

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]