TPAMiddle

From SCAR Divi Manual
Revision as of 00:42, 26 June 2011 by Freddy (talk | contribs) (Created page with "==Definition== <func>function TPAMiddle(const TPA: TPointArray): TPoint;</func> ==Availability== SCAR Divi 3.20 > Current ==Description== This function determines the center po...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

<func>function TPAMiddle(const TPA: TPointArray): TPoint;</func>

Availability

SCAR Divi 3.20 > Current

Description

This function determines the center point of a given TPointArray TPA by calculating the averages of the x and y coordinates.

Aliases

  • MiddleTPA

Example

var
  TPA: TPointArray;
  MiddlePoint: TPoint;
  
begin
  TPA := [Point(0, 0), Point(2, 2), Point(5, 10)];
  MiddlePoint := MiddleTPA(TPA);
  WriteLn('Middle-Point(' + IntToStr(MiddlePoint.x) + ',' + IntToStr(MiddlePoint.y) + ')');
end.

Output:

Middle-Point(2,4)

See Also