0

i have a function public static int[][][] rotate_alpha(int[][][] im,double alpha) which i have to use to rotate the image. the problem is im not able to find a soultion on how to do it with a given 3d array i have rotated the image 90 degrees but couldnt do it with a given degree(alpha) my code for 90 degrees rotation is:

    **int[][] res = new int[this.frame[0].length][this.frame.length];
    //Transpose
    for (int i = 0; i < this.frame[0].length; i++) {
        for (int j = 0; j < this.frame.length; j++) {
            res[i][j] = this.frame[this.frame.length - 1 - j][i];
        }
    }
    //copying res to the matrix array
    frame = res;**

this is an example on how to do it

0 Answers0