Difference between revisions of "RotateTPA"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> procedure RotateTPA(const TPA: TPointArray; const Center: TPoint; const Angle: Extended); </source> ==Availability== SCAR Divi ...")
 
(No difference)

Latest revision as of 16:53, 3 November 2011

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