I want to calculate the centroid of a figure formed by the points: (0,0), (70,0), (70,25), (45, 45), (45, 180), (95, 188), (95, 200), (-25, 200), (-25,188), (25,180), (25,45), (0, 25), (0,0).
I know that the correct result for the centroid of this polygon is x = 35 and y = 100.4615 (source), but the code below does not return the correct values (figure of the polygon below).
import numpy as np
points = np.array([(0,0), (70,0), (70,25), (45,45), (45,180), (95,188), (95,200), (-25,200), (-25, 188), (25,180), (25,45), (0,25), (0,0)])
centroid = np.mean(points, axis=0)
print("Centroid:", centroid)
Output: Centroid: [32.30769231 98.15384615]
How can I correctly calculate the centroid of the polygon?