ESBArcTan Function |
Unit
QESBPCSMath
Declaration
Function ESBArcTan(const X, Y: Extended): Extended;
Description
Results are given between -Pi and Pi.
Parameters |
X | First Float to process |
Y | Second Float to process |
Category
Arithmetic Routines for FloatsImplementation
function ESBArcTan (const X, Y: Extended): Extended; function FArcTan (X, Y: Extended): Extended; asm fld [Y] // St(0) <- Y fld [X] // St(0) <- X, St (1) <- Y fpatan // St(0) <- ArcTan (Y/X) fwait end; begin if FloatIsZero (X) then begin if FloatIsZero (Y) then Result := 0 else if Y > 0 then Result := PiOn2 else Result := -PiOn2 end else if FloatIsZero (Y) then begin if X > 0 then Result := 0 else Result := ESBPi end else Result := FArcTan (X, Y); End; |
|