Чтобы получить центр, я попытался для каждой вершины добавить к сумме, делить на число вершин.
Я также попытался найти самую верхнюю, самую нижнюю → получить среднюю точку... найти крайний левый крайний край, найти среднюю точку.
Оба из них не вернули идеальный центр, потому что я полагаюсь на центр, чтобы масштабировать многоугольник.
Я хочу масштабировать мои полигоны, поэтому я могу разместить вокруг них границу.
Каков наилучший способ найти центроид многоугольника, учитывая, что многоугольник может быть вогнутым, выпуклым и иметь много сторон разной длины?