* corrected atan to atan2 in ZXY convention