bestfit_line_numpy

compas.geometry.bestfit_line_numpy(points)[source]

Fit a line through a set of points.

Parameters:
pointsarray_like[point]

XYZ coordinates of the points.

Returns:
[float, float, float]

XYZ coordinates of a point on the line.

[float, float, float]

The direction vector of the line.

Raises:
ValueError

If the number of points is smaller than the dimensionality of the points. At least two points are needed for two-dimensional data. At least three points are needed for three-dimensional data.