# atan2

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: atan2
latest-operator-version: v26.2.4
latest-console-tag: v3.12.0
latest-connect-version: 4.113.1
latest-redpanda-tag: v26.2.4
docname: sql/sql-functions/math-functions/atan2
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-functions/math-functions/atan2.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/math-functions/atan2.adoc
description: The `atan2()` function returns the inverse tangent (arctangent) of y divided by x, expressed in radians.
page-topic-type: reference
page-git-created-date: "2026-09-08"
page-git-modified-date: "2026-09-08"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/math-functions/atan2.md -->

The `atan2()` function returns the inverse tangent (arctangent) of `y` divided by `x`, expressed in radians. Unlike [`atan()`](https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/math-functions/atan/), `atan2()` uses the signs of both arguments to determine the correct quadrant of the result. See also [`atan2d()`](https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/math-functions/atan2d/) to return the result in degrees.

## [](#syntax)Syntax

```sql
ATAN2(y, x)
```

## [](#arguments)Arguments

-   `y`: A number of type `real` or `double precision`.

-   `x`: A number of type `real` or `double precision`, of the same type as `y`.


## [](#return-type)Return type

Same as the input type (`real` or `double precision`).

## [](#examples)Examples

### [](#basic-usage)Basic usage

```sql
SELECT ATAN2(1, 0);
```

```sql
       atan2
-------------------
 1.5707963267948966
(1 row)
```

### [](#negative-y-value)Negative y value

```sql
SELECT ATAN2(-1, 0);
```

```sql
        atan2
---------------------
 -1.5707963267948966
(1 row)
```