Files
make2/apps/test/find_centroid.py
T
2024-12-27 11:34:28 +08:00

6 lines
199 B
Python

def get_centroid(points):
x_list = [point[0] for point in points]
y_list = [point[1] for point in points]
x = sum(x_list) / len(x_list)
y = sum(y_list) / len(y_list)
return (x, y)