in reply to Sorting issues
That would allow you to refer to the X component of a point $i as:my @points; # This will add one point (the first one in your arrays # above) to another type of data structure. my %this_point = {x => 0, y => 0, z => 25}; push @points, \%this_point; # Do this for as many points as you have. You can # adapt the method you use to fill your three arrays # to create this kind of data structure using the # example above.
(note: untested, but should give you the idea)# Sort by z first, then sort by x for each point @points = sort { $a->{x} <=> $b->{x} } sort { $a->{z} <=> $b->{z} } @points;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Sorting issues
by runrig (Abbot) on Jan 09, 2004 at 18:17 UTC | |
by Skylark (Beadle) on Jan 09, 2004 at 18:41 UTC | |
by jmanning2k (Pilgrim) on Jan 09, 2004 at 20:40 UTC | |
|
•Re: Re: Sorting issues
by merlyn (Sage) on Jan 09, 2004 at 18:12 UTC | |
by Skylark (Beadle) on Jan 09, 2004 at 18:24 UTC |