Ppeoc has asked for the wisdom of the Perl Monks concerning the following question:
Suppose I have the following coordinates:Eg: $rect_x[0], $rect_y[0] are the coordinates of rectangle 1. $point_x[0], $point_y[0] are some point linked to rectangle 1
Priority: (highest x coordinate, lowest y coordinate) I also need to have the the corresponding point coordinates for each sorted rectangle Thanks for the help!@rect_x = {3,2,4,0,3,0,4,0,3,2,0,4} @rect_y = {0,0,0,1,1,0,3,3,3,3,2,2} How can I sort this to get Rectangle 1 -> (4,0) Rectangle 2 -> (4,2) Rectangle 3 -> (4,3) Rectangle 4 -> (3,0) Rectangle 5 -> (3,1) Rectangle 6 -> (3,3) Rectangle 7 -> (2,0) Rectangle 8 -> (2,3) . . . . Rectangle n-1 -> (0,2) Rectangle n -> (0,3)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting geometric coordinates based on priority
by johngg (Canon) on Feb 02, 2017 at 23:15 UTC | |
|
Re: Sorting geometric coordinates based on priority
by FreeBeerReekingMonk (Deacon) on Feb 02, 2017 at 20:00 UTC | |
|
Re: Sorting geometric coordinates based on priority
by kcott (Archbishop) on Feb 03, 2017 at 03:13 UTC | |
|
Re: Sorting geometric coordinates based on priority
by NetWallah (Canon) on Feb 02, 2017 at 20:26 UTC |