code: public double[] homogeneRelativeVector(double[] v) {
      assert (v.length == dim);
      // TODO: this only works properly when trans[dim][dim] == 1.0, right?
      double[] dv = Arrays.copyOf(v, dim + 1);
      dv[dim] = 0.0;
      return dv;
    }
docs: Transform a relative vector into homogeneous coordinates.
  
  @param v initial vector
  @return vector of dim+1, with new column having the value 0.0