x是lat , y是lng
public static Point getCenterOfGravityPoint(List<Point> mPoints) {
double area = 0.0D;
double Gx = 0.0D;
double Gy = 0.0D;
for(int i = 1; i <= mPoints.size(); ++i) {
double iLat = ((Point)mPoints.get(i % mPoints.size())).getX();
double iLng = ((Point)mPoints.get(i % mPoints.size())).getY();
double nextLat = ((Point)mPoints.get(i - 1)).getX();
double nextLng = ((Point)mPoints.get(i - 1)).getY();
double temp = (iLat * nextLng - iLng * nextLat) / 2.0D;
area += temp;
Gx += temp * (iLat + nextLat) / 3.0D;
Gy += temp * (iLng + nextLng) / 3.0D;
}
Gx /= area;
Gy /= area;
return new Point(Gx, Gy);
}