I need to turn a double variable into an int variable and make sure it rounds correctly. So far I have been unable to do this and my scenario has not worked properly as a result. Can anyone help me?


int b = (double) a;
int b = (int) a;
double number = Math.atan((missileX - playerX)/(playerY - missileY)); // to double number = Math.atan2(missileY - playerY, missileX - playerX);
double number = Math.atan2((double)(missileY-playerY), (double)(missileX-playerX));
double number = Math.atan2((double)(missileY-playerY), (double)(missileX-playerX))*180.0/Math.PI;
double number = Math.toDegrees(Math.atan2((double)(playerY-missileY), (double)(playerX-missileX)));