code: public static double[] convertToDoubleArray(Matrix4d transformationMatrix) {
  		// Initialise the output array
  		double[] outArray = new double[16];
  		// Iterate over the matrix
  		for(int i=0; i<4; i++){
  			for(int j=0; j<4; j++){
  				// Now set this element
  				outArray[i*4+j] = transformationMatrix.getElement(i,j);
  			}
  		}
  		return outArray;
  	}
docs: Convert a four-d matrix to a double array. Row-packed.
  @param transformationMatrix the input matrix4d object
  @return the double array (16 long).