invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

ATAN2

Syntax

%%{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):

select atan2(0, 2)

--------
0

ATAN2 retrieves the angle of the tangent of the point (0, -1), rounded to four decimals:

select round(atan2(-1, 0), 4)

--------
-1.5708