You are viewing a single comment's thread. Return to all comments →
Crazy 2-liner in Python 3. :D
from math import pi, atan2 print("\n".join(map("{} {}".format, *zip(*sorted((list(map(int,input().split())) for _ in range(int(input()))), key=lambda x: (atan2(x[1], x[0]) % (2 * pi), x[0] ** 2 + x[1] ** 2))))))
Seems like cookies are disabled on this browser, please enable them to open this website
Polar Angles
You are viewing a single comment's thread. Return to all comments →
Crazy 2-liner in Python 3. :D