code: private GeneralMatrix fillVMatrix( int dim, Coordinate[] controlPoints ) {
          int controlPointsNum = controlPoints.length;
          GeneralMatrix V = new GeneralMatrix(controlPointsNum + 3, 1);
  
          for( int i = 0; i < controlPointsNum; i++ ) {
              V.setElement(i, 0, controlPoints[i].z);
          }
  
          V.setElement(V.getNumRow() - 3, 0, 0);
          V.setElement(V.getNumRow() - 2, 0, 0);
          V.setElement(V.getNumRow() - 1, 0, 0);
  
          return V;
      }
docs: Fill V matrix (matrix of target values).
  
  @param dim 0 for dx, 1 for dy.
  @return V Matrix