double he = 0;// 权和
double yh = 0;// y的和
CPoint p = points.startPoint();
for (int i = 1, n = points.size() - 1; i < n; i++)
{
Triangle trian = new Triangle(p, points.getCoordinate(i), points.getCoordinate(i + 1));
CPoint center = trian.computeCenter();
double area = trian.computeArea();
xh += area * center.getX();
yh += area * center.getY();
he += area;
}
double x = xh / he;