> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for ATAN2 function

# ATAN2

export const QueryWindow = ({content}) => {
  const {sql, result} = content;
  const [inited, setInited] = useState(false);
  const buttonRef = useRef(null);
  useEffect(() => {
    if (!inited && buttonRef.current) {
      runQuery(buttonRef.current, true);
      setInited(true);
    }
  }, []);
  return <div className="query-window">
      <div className="query-toolbar">
        <button className="run-button" onClick={ev => runQuery(ev.target)} ref={buttonRef}>Run Query</button>
        <span className="window-title">Interactive SQL Playground 🔥</span>
      </div>
      <div className="query-content">
        <pre><code className="firebolt-sql language-sql" contentEditable="true" spellCheck="false" data-original-query={sql}>{sql}</code></pre>
        <script type="application/json" className="fallback-result" style={{
    display: "none"
  }}>{JSON.stringify(result)}</script>
        <div className="server-unavailable-banner query-window-hidden">
          The Firebolt playground server is currently unavailable. Using precomputed query results.
        </div>
        <div className="query-results"></div>
      </div>
    </div>;
};

Two-argument arc tangent function. Calculates the angle, in radians, between the specified positive x-axis value and the ray from the origin to the point `(y,x)`.

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
ATAN2(<value_y>,<value_x>)
```

## Parameters

| Parameter   | Description                                  | Supported input types |
| :---------- | :------------------------------------------- | :-------------------- |
| `<value_y>` | The `y value` in the arc tangent calculation | `DOUBLE PRECISION`    |
| `<value_x>` | The `x value` in the arc tangent calculation | `DOUBLE PRECISION`    |

## Return Type

`DOUBLE PRECISION`

## Example

The following example calculates the arc tangent of the values `11` and `3`:

<QueryWindow
  content={{
"sql": "SELECT ATAN2(11,3) as result;",
"result": {
"data": [
  [
    1.3045442776439713
  ]
],
"meta": [
  {
    "name": "result",
    "type": "double"
  }
],
"query": {
  "query_id": "b30b50e5-7d67-48ea-be08-a5bcbbfeda89",
  "query_label": null,
  "request_id": "cf47e6c5-e19a-47aa-b52c-e0d0583e8a24"
},
"rows": 1,
"statistics": {
  "bytes_read": 1,
  "elapsed": 0.006679,
  "rows_read": 1,
  "scanned_bytes_cache": 0,
  "scanned_bytes_storage": 0,
  "time_before_execution": 0.000238821,
  "time_to_execute": 8.8783e-05
}
}
}}
/>
