let list = [
[464.1, 884.4],
[1.1, 884.4],
[1.1, 23.4],
[204.1, 23.4],
[464.1, 23.4],
];
function a(list) {
let area = 0.0;
let Gx = 0.0;
let Gy = 0.0;
for (let i = 1; i <= list.length; i++) {
let iLat = list[i % list.length][0];
let iLng = list[i % list.length][1];
let nextLat = list[i - 1][0];
let nextLng = list[i - 1][1];
let temp = (iLat * nextLng - iLng * nextLat) / 2.0;
area += temp;
Gx += (temp * (iLat + nextLat)) / 3.0;
Gy += (temp * (iLng + nextLng)) / 3.0;
}
Gx = Gx / area;
Gy = Gy / area;
return [Gx, Gy];
}
console.log(a(list));