---
title: "ATAN2"
description: "The ATAN2 SQL function returns the angle whose tangent is the quotient of two specified numbers."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/atan2
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/atan2
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> ATAN2[ATAN2]:::quoted
    ATAN2 --> End((END))
```

## Purpose
The `ATAN2` SQL function returns the angle whose tangent is the quotient of two specified numbers. 

See also [[TAN]] and [[ATAN]].

Parameters:
- y (`decimal`): the y coordinate of a point.
- x (`decimal`): the x coordinate of a point.

Returns: A number which represents the angle whose tangent is the quotient of two specified numbers as `decimal`.

## Examples
`ATAN2` retrieves the angle of the tangent of the point (2, 0):
```sql
select atan2(0, 2)

--------
0
```
`ATAN2` retrieves the angle of the tangent of the point (0, -1), rounded to four decimals:
```sql
select round(atan2(-1, 0), 4)

--------
-1.5708
```