Strange Problem
if(personality == 0){
pangle = Math.atan((pz - z)/(px - x));
temp = Math.toDegrees(pangle);
System.out.println(temp);
}
Will output the correct angle.
publicvoid update(float px,float py,float pz){
if(personality == 0){
pangle = Math.atan((pz - z)/(px - x));
temp = Math.toDegrees(pangle);
System.out.println(temp);
x = (float)(x + (SPEED * Math.cos(pangle)));
if((temp == 90) || (temp == 270)){
x = x;
}
z = (float)(z + (-1 * (SPEED * Math.sin(pangle))));
y = y;
}
Outputs NaN for the angle? Why is this. To me this is extremely strange since i have changed nothing before the output statement, only after it.
Any help would be greatly appreciated!

