Check Sheet Logo
Check Sheet

ATAN2

Returns the arctangent of the quotient of its arguments. ATAN2 is similar to ATAN, except that ATAN2 allows for two arguments and returns the angle of the result in the appropriate quadrant. This function is commonly used to calculate the angle between two points in a 2D plane. The angle is measured in radians and ranges from -pi to pi.

Usage

Use the ATAN2 formula with the syntax shown below, it has 2 required parameters:

=ATAN2(x, y)
Parameters:
  1. x (required):
    The x-coordinate of the point for which to calculate the angle.
  2. y (required):
    The y-coordinate of the point for which to calculate the angle.

Examples

Here are a few example use cases that explain how to use the ATAN2 formula in Google Sheets.

Calculate the angle between two points

To calculate the angle between two points in a 2D plane, use ATAN2 to find the angle of the vector between the two points relative to the x-axis.

Convert rectangular coordinates to polar coordinates

When given a point's rectangular coordinates (x, y), ATAN2 can be used to find the point's polar coordinates (r, θ), where r is the distance from the origin to the point and θ is the angle between the x-axis and the line connecting the origin and the point.

Calculate the direction of a vector

ATAN2 can be used to find the direction of a vector given its x and y components. This can be useful in physics or engineering applications where vectors are commonly used.

Common Mistakes

ATAN2 not working? Here are some common mistakes people make when using the ATAN2 Google Sheets Formula:

Incorrect number of arguments

ATAN2 requires exactly two arguments: x and y. Double-check that you have provided the correct number of arguments and that they are in the correct order.

Divide by zero error

If y is zero, ATAN2 will return an error. Make sure that y is not zero, or use an IF statement to handle this case.

Invalid input type

x and y must be numbers or cell references containing numbers. If you are encountering errors, make sure that your inputs are valid numbers or cell references.

Incorrect input order

The order of the inputs matters in ATAN2. The formula will return the arctangent of y/x. Double-check that you have entered the inputs in the correct order.

Mismatched parentheses

If you are encountering errors, check to make sure that all parentheses are properly matched and closed.

The following functions are similar to ATAN2 or are often used with it in a formula:

  • ATAN

    The ATAN function returns the arctangent of a value in radians, which is the angle whose tangent is a given value. This function is commonly used in trigonometry and geometry to calculate angles. The returned angle is in the range -π/2 to π/2.

  • SIN

    The SIN function in Google Sheets returns the sine of a given angle in radians. Sine is a mathematical function that describes a smooth repetitive oscillation. It is commonly used in trigonometry, physics, and engineering to model phenomena such as waves, oscillations, and periodic motion.

  • COS

    The COS function in Google Sheets returns the cosine of an angle provided in radians. It is commonly used in trigonometry to calculate the cosine of an angle. The function takes one parameter, the angle in radians.

  • TAN

    The TAN function returns the tangent of an angle specified in radians. Tangent is the ratio of the length of the opposite side to the length of the adjacent side of a right-angled triangle. This function is commonly used in trigonometry and geometry calculations.

Learn More

You can learn more about the ATAN2 Google Sheets function on Google Support.