ArcTan

From Delphi Pascal wiki
Jump to navigation Jump to search

Returns the arctangent of the argument.


Declaration
function ArcTan(X: Real): Real;


Target
Windows, Real, Protected


Remarks
Turbo Pascal does not have a Tan function, but tangents can be calculated with the expression: Sin(x) / Cos(x)
  • ArcSin(x) = ArcTan (x/sqrt (1-sqr (x)))
  • ArcCos(x) = ArcTan (sqrt (1-sqr (x)) /x)


Sample Code

{Arctan.PAS}
{Sample code for the ArcTan function.}

var
 R: Real;
begin
 R := ArcTan(Pi);
end.