code: public static double initialCenter(DenseMatrix64F points, DenseMatrix64F center)
      {
          assert points.numCols == 2;
          assert center.numCols == 1;
          assert center.numRows == 2;
          center.zero();
          int count = 0;
          int len1 = points.numRows;
          int len2 = len1-1;
          int len3 = len2-1;
          for (int i=0;i<len3;i++)
          {
              for (int j=i+1;j<len2;j++)
              {
                  for (int k=j+1;k<len1;k++)
                  {
                      if (center(points, i, j, k, center))
                      {
                          count++;
                      }
                  }
              }
          }
          if (count > 0)
          {
              divide(center, count);
              DenseMatrix64F di = new DenseMatrix64F(points.numRows, 1);
              computeDi(center, points, di);
              return elementSum(di) / (double)points.numRows;
          }
          else
          {
              return Double.NaN;
          }
      }
docs: Calculates an initial estimate for tempCenter.
  @param points
  @param center
  @return