Fortran Wiki
atan

Description

atan(x) computes the arctangent of x.

Standard

FORTRAN 77 and later; for a complex argument and for two arguments Fortran 2008 or later

Class

Elemental function

Syntax

result = atan(x)
result = atan(y, x)

Arguments

  • x - The type shall be real or complex; if y is present, x shall be real.
  • y - Shall be of the same type and kind as x.

Return value

The return value is of the same type and kind as x. If y is present, the result is identical to atan2(y,x). Otherwise, it the arcus tangent of x, where the real part of the result is in radians and lies in the range -\\pi / 2 \\leq \\mathop{Re}{\\atan(x)} \\leq \\pi / 2.

Example

program test_atan
  real(8) :: x = 2.866_8
  x = atan(x)
end program test_atan

See also

atan2, tan

category: intrinsics