TPAInTPARel

From SCAR Divi Manual
Revision as of 00:19, 21 October 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function TPAInTPARel(const TPA1, TPA2: TPointArray): Boolean; </source> ==Availability== SCAR Divi 3.28 > Current ==Descriptio...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function TPAInTPARel(const TPA1, TPA2: TPointArray): Boolean;

Availability

SCAR Divi 3.28 > Current

Description

Returns true if a series of points are found in TPA2 that are all at the same relative position towards eachother as the points in TPA1. The function does not take into account duplicate points.

Example

var
  TPA1, TPA2: TPointArray;

begin
  TPA1 := [Point(2, 5), Point(6, 1), Point(1, 1)];
  TPA2 := [Point(4, 7), Point(8, 3), Point(3, 3)];
  WriteLn(TPAInTPARel(TPA1, TPA2));

  TPA1 := [Point(2, 5), Point(6, 1), Point(1, 1)];
  TPA2 := [Point(0, 0), Point(4, 7), Point(1, 1), Point(8, 3), Point(3, 3)];
  WriteLn(TPAInTPARel(TPA1, TPA2));

  TPA1 := [Point(1, 5), Point(6, 1), Point(1, 1)];
  TPA2 := [Point(0, 0), Point(4, 7), Point(1, 1), Point(8, 3), Point(3, 3)];
  WriteLn(TPAInTPARel(TPA1, TPA2));
end.

Output:

1
1
0

See Also