Hey guys, I seriously need some help here.

I have no idea why but after undergoing the Rotation phase I lost
coordinatesRotZ[a][0],coordinatesRotZ[a][1]. The value appears to be 0.0
However coordinatesRotZ[a][2] has values stored in it.
so the output looks something like that after printing:

coordinatesRotZ[a][0] coordinatesRotZ[a][1] coordinatesRotZ[a][2]:
0.0 0.0 13.44
0.0 0.0 14.85

Thanks in advance!!

//---------------------------Translation---------------------------------------
    for(int a=0; a<coordinates1.length; a++) {
    	
        for(int b=0; b<3; b++){
            for(int c=0; c<3; c++){

                X = coordinates1[1][0]/coordinates2[1][0]; //alpha c coordinate
                Y = coordinates1[1][1]/coordinates2[1][1];
                Z = coordinates1[1][2]/coordinates2[1][2];

                double [][] Translation1={ {X,0.0,0.0}, {0.0,Y,0.0}, {0.0,0.0,Z} };

                coordinates2T[a][b] = coordinates2[a][c]*Translation1[c][b];
        
           

//-------------------------Rotation & RMSD Cal----------------------------------

//Uses Leohard Euler's angle of rotation theorem
//5 degrees in rad.

                double [][] Rotz={ {Math.cos(0.087266463), Math.sin(-0.087266463), 0.0},
                     {Math.sin(0.087266463), Math.cos(0.087266463), 0.0},
                    {0.0, 0.0 , 1.0} };

                double [][] RotX={ {1.0,0.0,0.0},
                    {0.0,Math.cos(0.087266463), Math.sin(-0.087266463)},
                    {0.0,Math.sin(0.087266463), Math.cos(0.087266463)} };

                double [][] RotZ={ {Math.cos(0.087266463), Math.sin(0.087266463), 0.0},
                    {Math.sin(-0.087266463), Math.cos(0.087266463), 0.0},
                    {0.0, 0.0 , 1.0} };

                coordinatesRotz[a][b]= coordinates2T[a][c]*Rotz[c][b];
                coordinatesRotX[a][b]= coordinatesRotz[a][c]*RotX[c][b];
                coordinatesRotZ[a][b]= coordinatesRotX[a][c]*RotZ[c][b];
              
              

            }
        }
    }

    for(int a=0; a<3; a++){
        R1=0; 
        for(int b=0; b<3; b++){
            R1 =Math.sqrt((Math.pow((coordinates1[a][0]-coordinatesRotZ[b][0]),2)
                +Math.pow((coordinates1[a][1]-coordinatesRotZ[b][1]),2)
                +Math.pow((coordinates1[a][2]-coordinatesRotZ[b][2]),2)));
                
            R2 = R1 + R2;
            
         // if(coordinatesRotZ[b][a] !=0.0)
             //System.out.println(Translation1[a][0]+"\t"+Translation1[a][1]+"\t"+Translation1[a][2]);
            //System.out.println(R2);
       }
    }
    
    RMSD_Final = R2 / 3.0;
    
    for(int a=0; a<3; a++){
    	for(int b=0; b<3; b++){
    		
    		if(coordinatesRotZ[a][b] !=0.0)
        System.out.println(coordinatesRotZ[a][0]+"\t"+coordinatesRotZ[a][1]+"\t"+coordinatesRotZ[a][2]);

please note after LINE 66, I did include the 2 closing brackets

Can you please include the entire code?

Can you please include the entire code?

it's okay, i think i got this part sorted! thanks! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.