Hi Rick,
thank you for your solution.
But, when I try to use your algorithm via GPS coordinates, the calculation does not work well with long decimals.
For example, coords data of a polygon:
CP1516190254.S 1 48.160426888 17.121807166
CP1516190254.S 2 48.160422807 17.121817646
CP1516190254.S 3 48.160403565 17.121869869
CP1516190254.S 4 48.160384151 17.12185281
CP1516190254.S 5 48.160407323 17.121790535
CP1516190254.S 6 48.160426888 17.121807166

it calculates centroid as 48.160163273 / 17.121744004 which is out of area.
I had to do changes like define new values:
X1000=(X*1000) - 17000;
Y1000=(Y*1000) - 48000;
P1000=X1000 || Y1000;
centroid = _PolyCentroid(P1000);

and in the calculation calculate it back:
cy1000=(cy+48000)/1000;
cx1000=(cx+17000)/1000;
return( cx1000 || cy1000 );

With this calculation is the centroid in 48.160405 / 17.12183
Thank you.