Difference between revisions of "RotatePoint"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> function RotatePoint(const Point, Center: TPoint; const Angle: Extended): TPoint; </source> ==Availability== SCAR Divi 3.28 > C...") |
(→Example) |
||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
==Description== | ==Description== | ||
− | [ | + | [http://en.wikipedia.org/wiki/Rotation_%28mathematics%29 Rotates] a given [[TPoint]] '''Point''' around a TPoint '''Center''' by an angle defined in radians in '''Angle'''. |
==Example== | ==Example== | ||
Line 14: | Line 14: | ||
var | var | ||
p: TPoint; | p: TPoint; | ||
+ | |||
begin | begin | ||
p := RotatePoint(Point(1, 1), Point(0, 0), Pi / 2); | p := RotatePoint(Point(1, 1), Point(0, 0), Pi / 2); |
Latest revision as of 16:51, 3 November 2011
Definition
function RotatePoint(const Point, Center: TPoint; const Angle: Extended): TPoint;
Availability
SCAR Divi 3.28 > Current
Description
Rotates a given TPoint Point around a TPoint Center by an angle defined in radians in Angle.
Example
var p: TPoint; begin p := RotatePoint(Point(1, 1), Point(0, 0), Pi / 2); WriteLn(IntToStr(p.X) + ',' + IntToStr(p.Y)); p := RotatePoint(Point(1, 1), Point(0, 1), Pi / 2); WriteLn(IntToStr(p.X) + ',' + IntToStr(p.Y)); end.
Output:
-1,1 0,2