public static Matrix getRotationMatrix(int axis, double angle)
			throws IndexOutOfBoundsException {
		if (axis < X_AXIS || axis > Z_AXIS)
			throw new IndexOutOfBoundsException();

		double c = Math.cos(angle);
		double s = Math.sin(angle);

		Matrix rotate = Matrix.getIdentityMatrix();

		switch (axis) {
		case X_AXIS:
			rotate.setDiagonal(1, c);
			rotate.setDiagonal(2, c);
			rotate.setAntiSymmetricComponent(2, 1, s);
			break;

		case Y_AXIS:
			rotate.setDiagonal(0, c);
			rotate.setDiagonal(2, c);
			rotate.setAntiSymmetricComponent(0, 2, s);
			break;

		case Z_AXIS:
			rotate.setDiagonal(0, c);
			rotate.setDiagonal(1, c);
			rotate.setAntiSymmetricComponent(1, 0, s);
			break;
		}

		return rotate;
	}