public static int[] rotate2(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));

			    int y = (int)(p * Math.cos(a - Math.PI * t) + owh/2);
			    int x = (int)(p * Math.sin(a - Math.PI * t) + owh/2);
			    
				int index = i * owh + j;
				if (x >= 0 && x <= owh - 1 && y >= 0 && y <= owh - 1) {
					opix[index] = pix[y * owh + x];
				}

			}
		}
		return opix;
	}