TPACenter

From SCAR Divi Manual
Revision as of 17:33, 19 April 2012 by Freddy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function TPACenter(const TPA: TPointArray): TPoint;

Availability

SCAR Divi 3.33 > Current

Description

Returns the coordinate at the center of the box that encloses all points inside of the given TPointArray TPA. The function rounds down if one or both of the dimensions of the enclosing box are even.

Example

var
  TPA: TPointArray;   
  P: TPoint;
  
begin
  TPA := [Point(0, 0), Point(2, 2), Point(2, 4)];                 
  P := TPACenter(TPA);
  WriteLn(TPAToStr([P]));
end.

Output:

(1,2)