help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions] Reference for unit 'math' (#rtl)

arctan2

Return arctangent of (y/x)

Declaration

Source position: math.pp line 274

function arctan2(

  y: float;

  x: float

):float;

Description

arctan2 calculates arctan(y/x), and returns an angle in the correct quadrant. The returned angle will be in the range $-\pi$ to $\pi$ radians. The values of x and y must be between -2\^{}64 and 2\^{}64, moreover x should be different from zero. On Intel systems this function is implemented with the native intel fpatan instruction.

Errors

If x is zero, an overflow error will occur.

See also

arccos

  

Return inverse cosine

arcosh

  

Return inverse hyperbolic cosine

arsinh

  

Return inverse hyperbolic sine

artanh

  

Return inverse hyperbolic tangent

Example

Program Example6;

{ Program to demonstrate the arctan2 function. }

Uses math;

  Procedure WriteRadDeg(X : float);

  begin
    Writeln(X:8:5,' rad = ',radtodeg(x):8:5,' degrees.')
  end;

begin
  WriteRadDeg (arctan2(1,1));
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505