Arduino board and MPU6050

Im doing a school project and I am a newbie at programing even more programing an Arduino. I found the code that I will be using I know what It does but I am not 100 percent what every line of the code means. #include<Wire.h>

const int MPU_addr=0x68;
int16_t axis_X,axis_Y,axis_Z;
int minVal=265;
int maxVal=402;
double x;
double y;
double z;

void setup(){

Wire.begin();
Wire.beginTransmission(MPU_addr);
Wire.write(0x6B);
Wire.write(0);
Wire.endTransmission(true);
Serial.begin(9600);
}

void loop(){
Wire.beginTransmission(MPU_addr);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true);
axis_X=Wire.read()<<8|Wire.read();
axis_Y=Wire.read()<<8|Wire.read();
axis_Z=Wire.read()<<8|Wire.read();
int xAng = map(axis_X,minVal,maxVal,-90,90);
int yAng = map(axis_Y,minVal,maxVal,-90,90);
int zAng = map(axis_Z,minVal,maxVal,-90,90);
x= RAD_TO_DEG * (atan2(-yAng, -zAng)+PI);
y= RAD_TO_DEG * (atan2(-xAng, -zAng)+PI);
z= RAD_TO_DEG * (atan2(-yAng, -xAng)+PI);
Serial.print("Angle of inclination in X axis = ");
Serial.print(x);
Serial.println((char)176);
/* Serial.print("Angle of inclination in Y axis= ");
Serial.print(y);
Serial.println((char)176);
Serial.print("Angle of inclination in Z axis= ");
Serial.print(z);
Serial.println((char)176);*/
Serial.println("-------------------------------------------");
delay(1000);
}

Can anyone explain what every line of code means? BTW this code measures the angle of inclination in the X, Y, Z axis.

That is really bad code. I would not recommend that you study it.

This section is all wrong:

int xAng = map(axis_X,minVal,maxVal,-90,90);
int yAng = map(axis_Y,minVal,maxVal,-90,90);
int zAng = map(axis_Z,minVal,maxVal,-90,90);
x= RAD_TO_DEG * (atan2(-yAng, -zAng)+PI);
y= RAD_TO_DEG * (atan2(-xAng, -zAng)+PI);
z= RAD_TO_DEG * (atan2(-yAng, -xAng)+PI);

Instead, you might find this tutorial interesting, and it has the benefit of using the correct equations for calculating the tilt angles. How_to_Use_a_Three-Axis_Accelerometer_for_Tilt_Sensing-DFRobot

To learn about the trigonometry behind tilt sensing, see this application note: https://cache.freescale.com/files/sensors/doc/app_note/AN3461.pdf

It is complicated by the fact that there are several different standards for 3D angular measurements.

thanks for the heads up! Do you have any idea on where I can start or template that might help me out?

There is nothing wrong with the code that simply reads out raw acceleration values from the sensor.

Cut out the block of wrong code, indicated above, and substitute tilt code (appropriately modified if necessary) from the DFrobot link.

Also remove all lines like this:

Serial.println((char)176);

It would be best if you understood the calculations involved.