public static String assertRationalUnitVector(double[] vector,
			int decimalPlaces) {

		if (vector == null) {

			return "The unit vector is null";

		}

		if (vector.length != 3) {

			return "The unit vector does not comprise three elements: "
					+ representVector(vector, decimalPlaces);

		}

		double x = vector[0];
		double y = vector[1];
		double z = vector[2];

		BigDecimal xsquared = new BigDecimal(x).pow(2);
		BigDecimal ysquared = new BigDecimal(y).pow(2);
		BigDecimal zsquared = new BigDecimal(z).pow(2);

		BigDecimal sum = xsquared.add(ysquared).add(zsquared);

		BigDecimal rounded = sum.divide(BigDecimal.ONE, decimalPlaces,
				RoundingMode.HALF_EVEN);

		if (rounded.compareTo(BigDecimal.ONE) == 0) {

			return null;

		}

		return "The unit vector does not conform with Pythagoras' theorem: "
				+ representVector(vector, decimalPlaces);

	}