Difference between revisions of "TPADensity"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function TPADensity(const TPA: TPointArray): Extended; </source> ===Source Code=== <source lang="scar"> function TPADensity(con...")
 
(Definition)
Line 8: Line 8:
 
function TPADensity(const TPA: TPointArray): Extended;
 
function TPADensity(const TPA: TPointArray): Extended;
 
begin
 
begin
   Result := MyTPAArea(TPA) / Length(TPA);
+
   Result := TPAArea(TPA) / Length(TPA);
 
end;
 
end;
 
</source>
 
</source>

Revision as of 09:07, 3 July 2011

Definition

function TPADensity(const TPA: TPointArray): Extended;

Source Code

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

Availability

SCAR Divi 3.26 > Current

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