code: private ProjectedEnergy projectedEnergy(Relation<V> relation, ORCLUSCluster c_i, ORCLUSCluster c_j, int i, int j, int dim) {
      NumberVectorDistanceFunction<? super V> distFunc = SquaredEuclideanDistanceFunction.STATIC;
      // union of cluster c_i and c_j
      ORCLUSCluster c_ij = union(relation, c_i, c_j, dim);
  
      double sum = 0.;
      NumberVector c_proj = DoubleVector.wrap(project(c_ij, c_ij.centroid));
      for(DBIDIter iter = c_ij.objectIDs.iter(); iter.valid(); iter.advance()) {
        NumberVector o_proj = DoubleVector.wrap(project(c_ij, relation.get(iter).toArray()));
        sum += distFunc.distance(o_proj, c_proj);
      }
      sum /= c_ij.objectIDs.size();
  
      return new ProjectedEnergy(i, j, c_ij, sum);
    }
docs: Computes the projected energy of the specified clusters. The projected
  energy is given by the mean square distance of the points to the centroid
  of the union cluster c, when all points in c are projected to the subspace
  of c.
  
  @param relation the relation holding the objects
  @param c_i the first cluster
  @param c_j the second cluster
  @param i the index of cluster c_i in the cluster list
  @param j the index of cluster c_j in the cluster list
  @param dim the dimensionality of the clusters
  @return the projected energy of the specified cluster