public static double getDet(double[][] A){
		if(A.length != A[0].length)
			return Double.NaN;
		double det = 0;
		int cofact = 0;
		if(A.length == 1)
			return A[0][0];
		for(int i = 0; i<A.length; i++){
			double[][] T = new double[A.length-1][A.length-1];
			for(int j = 1; j<A.length; j++){
				for(int k = 0; k<A.length; k++){
					if(k<i)
						T[j-1][k] = A[j][k];
					else if(k >i)
						T[j-1][k-1] = A[j][k];
				}
			}
			if(i%2 == 0)
				cofact = 1;
			else
				cofact = -1;
			det += cofact*A[0][i]*(getDet(T));
		}
		return det;
	} //end getDet method