Sort the points in ascending order
for i in range ( len ( points ) ) : NEW_LINE INDENT points [ i ] = points [ i ] [ : : - 1 ] NEW_LINE DEDENT points = sorted ( points ) NEW_LINE for i in range ( len ( points ) ) : NEW_LINE INDENT points [ i ] = points [ i ] [ : : - 1 ] NEW_LINE DEDENT