public static double[][] rotation3D(double[] axis, double angle) {
		double[][] res = new double[3][3];
		if (axis.length == 3) {
			double nx = axis[0];
			double ny = axis[1];
			double nz = axis[2];
			double cos = Math.cos(angle);
			double sin = Math.sin(angle);
			res[0][0] = nx*nx*(1 - cos) + cos;
			res[1][0] = nx*ny*(1 - cos) - nz*sin;
			res[2][0] = nx*nz*(1 - cos) + ny*sin;
			
			res[0][1] = nx*ny*(1 - cos) + nz*sin;
			res[1][1] = ny*ny*(1 - cos) + cos;
			res[2][1] = ny*nz*(1 - cos) - nx*sin;
			
			res[0][2] = nx*nz*(1 - cos) - ny*sin;
			res[1][2] = ny*nz*(1 - cos) + nx*sin;
			res[2][2] = nz*nz*(1 - cos) + cos;
		}
		return toHomogeneousCoordinates(res);
	}