arithmetic error fixed
atan function missed