RotateTPA

From SCAR Divi Manual
Revision as of 16:53, 3 November 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> procedure RotateTPA(const TPA: TPointArray; const Center: TPoint; const Angle: Extended); </source> ==Availability== SCAR Divi ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

procedure RotateTPA(const TPA: TPointArray; const Center: TPoint; const Angle: Extended);

Availability

SCAR Divi 3.28 > Current

Description

Rotates all points in a given TPointArray TPA around a TPoint Center by an angle defined in radians in Angle.

Example

var
  TPA: TPointArray;

begin
  TPA := [Point(1, 1), Point(-1, 1), Point(2, 0)];
  RotateTPA(TPA, Point(0, 0), Pi / 2);
  WriteLn(TPAToStr(TPA));

  TPA := [Point(1, 1), Point(-1, 1), Point(2, 0)];
  RotateTPA(TPA, Point(0, 1), Pi / 2);
  WriteLn(TPAToStr(TPA));
end.

Output:

(-1,1);(-1,-1);(0,2)
(0,2);(0,0);(1,3)

See Also