TPADistToPoint

From SCAR Divi Manual
Revision as of 13:24, 21 November 2012 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> procedure TPADistToPoint(const TPA: TPointArray; const Point: TPoint; out MinDist, MaxDist: Extended); </source> ==Availabil...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

procedure TPADistToPoint(const TPA: TPointArray; const Point: TPoint; out MinDist, MaxDist: Extended);

Availability

SCAR Divi 3.37 > Current

Description

Calculates the minimum and maximum distance of the TPoint Point, to all of the points in the TPointArray TPA and returns the distances in MinDist and MaxDist. An extended version of this function is available as TPADistToPointEx.

Example

var
  MinDist, MaxDist: Extended;

begin
  TPADistToPoint([Point(0, 0), Point(3, 0)], Point(1, 1), MinDist, MaxDist);
  WriteLn(MinDist);                                                          
  WriteLn(MaxDist);
end.

Output:

1.4142135623731
2.23606797749979

See Also