hypot instead of x*x+y*y makes more numr stable
UNTESTED CODE! made dead-reconing better