new function: sort_by_atan2