mrdja.geometry.get_centroid_of_points

mrdja.geometry.get_centroid_of_points(points: ndarray) ndarray[source]

Get the centroid of a set of points.

Parameters:

points (np.ndarray) – Points.

Returns:

Centroid.

Return type:

np.ndarray

Example:

>>> import mrdja.geometry as geom
>>> import numpy as np
>>> points = np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0]])
>>> centroid = geom.get_centroid_of_points(points)
>>> centroid
array([0.33333333, 0.33333333, 0.        ])