ESBArcCos Function
Given a Value returns the Angle whose Cosine it is, in Radians.

Unit
QESBPCSMath

Declaration
Function ESBArcCos(const X: Extended): Extended;

Description
Return Values are between 0 and Pi.

Parameters
Float to process.

Category
Arithmetic Routines for Floats

Implementation

function ESBArcCos (const X: Extended): Extended;
var
     Y: Extended;
begin
     if abs (X) > 1 then
          raise EMathError.Create (rsValueLEOne);

     if X = 0 then
          Result := PiOn2
     else
     begin
          Y := Sqrt (1 - Sqr (X));
          if FloatIsZero (Y) then
          begin
               if X > 0 then
                    Result := 0
               else
                    Result := ESBPi
          end
          else
               Result := ESBArcTan (X, Y)
     end;
End;


HTML generated by Time2HELP
http://www.time2help.com