Difference between revisions of "SortTPA"

From SCAR Divi Manual
Jump to: navigation, search
(See Also)
Line 30: Line 30:
 
==See Also==
 
==See Also==
 
*[[SortTPAEx]]
 
*[[SortTPAEx]]
*[[ATPASortBySize]]
+
*[[SortATPABySize]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:TPA Functions]]
 
[[Category:TPA Functions]]
 
[[Category:Array Functions]]
 
[[Category:Array Functions]]

Revision as of 15:11, 23 October 2011

Definition

procedure SortTPA(var TPA: TPointArray);

Availability

SCAR Divi 3.28 > Current

Aliases

  • TPASort(SCAR Divi 3.26 > Current)

Description

Sorts a given TPointArray TPA by distance from the origin (0, 0) using the fast ShellSort algorithm. An extended function with additional functionality is available as SortTPAEx.

Example

var
  TPA: TPointArray;

begin
  TPA := [Point(2, 2), Point(0, 0), Point(5, 10), Point(0, 0)];
  SortTPA(TPA);
  WriteLn('TPointArray: ' + TPAToStr(TPA));
end.

Output:

TPointArray: (0,0);(0,0);(2,2);(5,10)

See Also