ATAN2 function

This topic describes the formula syntax and usage of the ATAN2 function in the Data Quality Execute Formula transform.

Description

Returns the arctangent, or inverse tangent, of the specified x- and y-coordinates. The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a point with coordinates (x_num, y_num). The angle is given in radians between -π and π, excluding -π.

Tip: If you want to convert the result from radians to degrees, multiply it by 180/PI() or use the DEGREES function.

Syntax

ATAN2(x_num, y_num)

The ATAN2 function syntax has the following arguments:

  • x_num Required. The x-coordinate of the point.
  • y_num Required. The y-coordinate of the point.

Comments

  • A positive result represents a counterclockwise angle from the x-axis. A negative result represents a clockwise angle.
  • ATAN2(ab) = ATAN(b/a), except that the ratio on the right side is undefined when a = 0.

Example

Data: Two column values, X_COORDINATE=1, Y_COORDINATE=1
Formula Description Result
ATAN2([X_COORDINATE],[Y_COORDINATE]) Arctangent of the point 1,1, in radians, π/4 0.785398163
DEGREES(ATAN2([X_COORDINATE],[Y_COORDINATE])) Arctangent of the point 1,1 in degrees -135
Data: Two column values, X_COORDINATE=-1, Y_COORDINATE=-1
Formula Description Result
ATAN2([X_COORDINATE],[Y_COORDINATE]) Arctangent of the point 1,1, in radians,-3*π/4 -2.35619449
ATAN2([X_COORDINATE],[Y_COORDINATE])*180/PI() Arctangent of the point 1,1, in degrees -135