public static Double idealGasLaw(Double p, Double v, Double n, Double t)
	{
		boolean[] nulls = new boolean[4];
		nulls[0] = (p == null);
		nulls[1] = (v == null);
		nulls[2] = (n == null);
		nulls[3] = (t == null);
		
		int nullCount = 0;
		for(int k = 0; k < nulls.length; k++)
		{
			if(nulls[k])
				nullCount++;
		}
		
		if(nullCount != 1)
			return null;
		
		double result = 0;
		
		if(nulls[0])
		{
			// p is unknown
			result = n*Rlatm*t/v;
		}
		else if(nulls[1])
		{
			// v is unknown
			result = n*Rlatm*t/p;
		}
		else if(nulls[2])
		{
			// n is unknown
			result = p*v/(Rlatm*t);
		}
		else if(nulls[3])
		{
			// t is unknown
			result = p*v/(Rlatm*n);
		}
		
		return result;
	}