public static int[] rotate2Bilinear(int[] pix, float beta, int iw, int ih, int owh) {
		pix = GT.translate(pix, (owh-iw)/2, (owh-ih)/2, iw, ih, owh, owh);
		
		int[] opix = new int[owh * owh];
		double t = beta / 180;
		
		for (int i = 0; i < owh; i++) {
			for (int j = 0; j < owh; j++) {
			    double p = Math.sqrt((j - owh/2 ) * (j - owh/2) + (i - owh/2) * (i - owh/2));
			    double a = Math.atan2((j - owh/2), (i - owh/2));
			    

			    double v = p * Math.cos(a - Math.PI * t) + owh/2;
			    double u = p * Math.sin(a - Math.PI * t) + owh/2;
			    
				
			    double dy = v;
				int iy = (int)dy;
				double d_y = dy-iy;
				
				double dx = u;
				int ix = (int)dx;
				double d_x = dx -ix;
				
				if (ix >= 0 && ix < owh - 1 && iy >= 0 && iy < owh - 1) {
					int g = (int)(
							(1-d_x)	*(1-d_y)	*pix[iy*owh+ix]+
							(d_x)	*(1-d_y)	*pix[iy*owh+ix+1]+
							(1-d_x)	*(d_y)		*pix[(iy+1)*owh+ix]+
							(d_x)	*(d_y)		*pix[(iy+1)*owh+ix+1]
							);
					opix[i*owh+j] = g;
				}
			}
		}
		return opix;
	}