mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-09 22:06:08 +02:00
* Added DegNormalize
git-svn-id: trunk@27492 -
This commit is contained in:
parent
4563b2994d
commit
d45ced0221
@ -244,6 +244,15 @@ function gradtodeg(grad : float) : float;inline;
|
||||
{ one cycle are 2*Pi rad }
|
||||
function cycletorad(cycle : float) : float;inline;
|
||||
function radtocycle(rad : float) : float;inline;
|
||||
{$ifdef FPC_HAS_TYPE_SINGLE}
|
||||
Function DegNormalize(deg : single) : single; inline;
|
||||
{$ENDIF}
|
||||
{$ifdef FPC_HAS_TYPE_DOUBLE}
|
||||
Function DegNormalize(deg : double) : double; inline;
|
||||
{$ENDIF}
|
||||
{$ifdef FPC_HAS_TYPE_EXTENDED}
|
||||
Function DegNormalize(deg : extended) : extended; inline;
|
||||
{$ENDIF}
|
||||
|
||||
{ trigoniometric functions }
|
||||
|
||||
@ -670,6 +679,31 @@ function radtocycle(rad : float) : float;inline;
|
||||
radtocycle:=rad*(1/(2*pi));
|
||||
end;
|
||||
|
||||
{$ifdef FPC_HAS_TYPE_SINGLE}
|
||||
Function DegNormalize(deg : single) : single;
|
||||
|
||||
begin
|
||||
Result:=Deg-Trunc(Deg/360)*360;
|
||||
If Result<0 then Result:=Result+360;
|
||||
end;
|
||||
{$ENDIF}
|
||||
{$ifdef FPC_HAS_TYPE_DOUBLE}
|
||||
Function DegNormalize(deg : double) : double; inline;
|
||||
|
||||
begin
|
||||
Result:=Deg-Trunc(Deg/360)*360;
|
||||
If (Result<0) then Result:=Result+360;
|
||||
end;
|
||||
{$ENDIF}
|
||||
{$ifdef FPC_HAS_TYPE_EXTENDED}
|
||||
Function DegNormalize(deg : extended) : extended; inline;
|
||||
|
||||
begin
|
||||
Result:=Deg-Trunc(Deg/360)*360;
|
||||
If Result<0 then Result:=Result+360;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
{$ifndef FPC_MATH_HAS_TAN}
|
||||
function tan(x : float) : float;
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user