code: protected void findCenter() {
          center = new float[]{0, 0};
          int length = points.length;
          for(int i=0;i<length;i+=2) {
              center[0] += points[i];
              center[1] += points[i + 1];
          }
          center[0] /= (length / 2);
          center[1] /= (length / 2);
      }
docs: Get the center of this polygon.