mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 01:59:34 +02:00
LazUtils/GraphMath: Optimize RotatePoint().
This commit is contained in:
parent
898f4009c0
commit
182091e424
@ -1038,8 +1038,7 @@ function RotatePoint(const APoint: TPoint; AAngle: Double): TPoint;
|
||||
var
|
||||
sa, ca: Double;
|
||||
begin
|
||||
sa := sin(AAngle);
|
||||
ca := cos(AAngle);
|
||||
SinCos(AAngle, sa, ca);
|
||||
Result.X := Round( ca * APoint.X + sa * APoint.Y);
|
||||
Result.Y := Round(-sa * APoint.X + ca * APoint.Y);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user