private double hilb_index(double x, double y, int lvl){
		if (lvl==0) return x;
		if ( x<0.5 && y<0.5 )
			return hilb_index(y*2, x*2, lvl-1)*0.25;

		if ( x<0.5 && y>=0.5)
			return 0.25 + hilb_index(x*2, y*2-1, lvl-1)*0.25;

		if (x>=0.5 && y<0.5)
			return  0.75 + hilb_index(1-y*2, 2-x*2, lvl-1)*0.25;

		if (x>=0.5 && y>=0.5)
			return 0.5 + hilb_index(x*2-1, y*2-1, lvl-1)*0.25;
		
		throw new RuntimeException("hilb-index: coordinate is invalid");
	}