Skip to content

ATAN2 function

Overview

ATAN2 is a function of the Math and Trigonometry category that calculates the inverse tangent (arctangent) for the specified x and y coordinates. The arctangent returns the angle defined by the x-axis and a line defined by the origin and a point with coordinates (x,y). The returned angle is expressed in radians, in the range (-π, +π].

Usage

Syntax

ATAN2(x,y) => atan2

Argument descriptions

  • x (number, required). Value of the x coordinate.
  • y (number, required). Value of the y coordinate.

Additional guidance

If the returned value is positive, it represents a counterclockwise angle from the x-axis, while a negative value represents a clockwise angle.
ATAN2(x,y) is equivalent to ATAN(y/x), with the difference that the x argument in ATAN2 can be 0.

Returned value

ATAN2 returns a number in radians in the range (-π, +π] that is the inverse tangent for the specified x and y coordinates.

Error conditions

  • In common with many other IronCalc functions, ATAN2 propagates errors that are found in its argument.
  • If no argument, or arguments other than 2, are supplied, then ATAN2 returns the #ERROR! error.
  • If the value of either the x or y argument is not (or cannot be converted to) a number, then ATAN2 returns the #VALUE! error.
  • If both x and y are equal to 0, ATAN2 returns a #DIV/0! error.
  • For more information about the different types of errors that you may encounter when using IronCalc functions, visit our Error Types page.

Details

Examples

See some examples in IronCalc.