gyanítom, hogy ez a baj: http://perldoc.perl.org/functions/atan2.html A Perles megoldásban a paraméterek sorrendje Y, X