|
|
Line 1: |
Line 1: |
− | ==Definition==
| + | #REDIRECT [[SortATPAByMean]] |
− | <source lang="scar" lines="false">
| |
− | procedure SortATPAByMiddle(var ATPA: T2DPointArray);
| |
− | </source>
| |
| | | |
− | ==Availability==
| + | [[Category:Deprecated Functions]] |
− | SCAR Divi 3.28 > Current
| |
− | | |
− | ==Description==
| |
− | Sorts the given [[T2DPointArray]] '''ATPA''' by the distance of the middle of the points of every non-empty subarray calculated with [[TPAMiddle]] to the origin (0,0) using the fast [http://en.wikipedia.org/wiki/Shell_sort ShellSort] algorithm. Empty subarrays are placed at the start of the array. An extended function with additional functionality is available as [[SortATPAByMiddleEx]].
| |
− | | |
− | ==Example==
| |
− | <source lang="scar">
| |
− | var
| |
− | ATPA: T2DPointArray;
| |
− | i: Integer;
| |
− | | |
− | begin
| |
− | SetLength(ATPA, 3);
| |
− | ATPA[0] := [Point(1, 6), Point(5, 4), Point(1, 5)];
| |
− | ATPA[1] := [Point(1, 1), Point(2, 2)];
| |
− | ATPA[2] := [Point(5, 10)];
| |
− | SortATPAByMiddle(ATPA);
| |
− | for i := 0 to High(ATPA) do
| |
− | WriteLn(TPAToStr(ATPA[i]));
| |
− | end.
| |
− | </source>
| |
− | | |
− | Output:
| |
− | (1,1);(2,2)
| |
− | (1,6);(5,4);(1,5)
| |
− | (5,10)
| |
− | | |
− | ==See Also==
| |
− | *[[SortATPAByMiddleEx]]
| |
− | *[[SortATPAByFirst]]
| |
− | *[[SortATPAByFirstEx]]
| |
− | *[[SortATPABySize]]
| |
− | | |
− | [[Category:Functions]]
| |
− | [[Category:TPA Functions]]
| |
− | [[Category:Array Functions]] | |