ATAN2
Returns the arctangent of y/x, preserving quadrant information.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=ATAN2(x_num, y_num)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
x_num | number | Required | — |
y_num | number | Required | — |
Remarks
- Formualizer uses Excel-style argument order:
ATAN2(x_num, y_num).
Error cases
- Returns
#DIV/0!when both arguments are zero.
Examples
Measure the angle of a point in the first quadrant.
Formula =ATAN2(3,4)
Expected result 0.927295218001612
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Move the point to the second quadrant without changing its height.
Formula =ATAN2(-3,4)
Expected result 2.21429743558818
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Find the angle of a point on the positive vertical axis.
Formula =ATAN2(0,1)
Expected result 1.5707963267949
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The origin does not define a direction.
Formula =ATAN2(0,0)
Expected result #DIV/0!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
First quadrant angle
Formula =ATAN2(1,1)
Expected result 0.785398163397448
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
Why does ATAN2 return #DIV/0! at (0,0)?
The origin has no defined direction angle, so ATAN2 reports #DIV/0!.