I want to sort an array which has factors as ((x1, y1), (x2, y2)) and represents both of edges of a line, according to each of lengths in Julia.
I cannot write because of dim-difference between Python and Julia.
In Python, lines are sorted like follows;
lines = [ ((l[0][0], l[0][1]), (l[0][2], l[0][3])) for l in lines ]
lines.sort(key = lambda l: -sqrt((l[0][0]-l[1][0])**2+(l[0][1]-l[1][1])**2))
How to write the same process in Julia?