code: public Coordinate getCentroid() {
  		if (isEmpty()) {
  			return null;
  		}
  		double area = getSignedArea();
  		double x = 0;
  		double y = 0;
  		Coordinate[] coordinates = getCoordinates();
  		for (int i = 1; i < coordinates.length; i++) {
  			double x1 = coordinates[i - 1].getX();
  			double y1 = coordinates[i - 1].getY();
  			double x2 = coordinates[i].getX();
  			double y2 = coordinates[i].getY();
  			x += (x1 + x2) * (x1 * y2 - x2 * y1);
  			y += (y1 + y2) * (x1 * y2 - x2 * y1);
  		}
  		x = x / (6 * area);
  		y = y / (6 * area);
  		return new Coordinate(x, y);
  	}
docs: The centroid is also known as the "center of gravity" or the "center of mass".
  
  @return Return the center point.