TPADensity

From SCAR Divi Manual
Revision as of 23:53, 11 March 2012 by Freddy (talk | contribs)
Jump to: navigation, search

Definition

function TPADensity(const TPA: TPointArray): Extended;

Source Code

function TPADensity(const TPA: TPointArray): Extended;
begin
  Result := Length(TPA) / TPAArea(TPA);
end;

Availability

SCAR Divi 3.26 > Current

  • For SCAR Divi 3.31 and older, this function was bugged, if you're using those versions, please use the source code above.

Description

Calculates the density of a given TPointArray TPA.

Example

begin
  WriteLn(TPADensity([Point(0, 0), Point(1, 2), Point(5, 4)]));
end.

Output:

10

See Also