---
title: "ATAN2"
description: "ATAN2 SQL\u95A2\u6570\u306F\u3001\u6307\u5B9A\u3055\u308C\u305F2\u3064\u306E\u6570\u5024\u306E\u5546\u3092\u6B63\u63A5\u3068\u3059\u308B\u89D2\u5EA6\u3092\u8FD4\u3057\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/docs/invantive-universalsql/grammar/sql-functions/atan2
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/atan2
updated: 2026-12-04T13:19:52Z
license: https://documentation.invantive.eu/ja/
---

## 構文
```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))
```

## 目的
`ATAN2` SQL関数は、指定された2つの数値の商を正接とする角度を返します。

関連項目：[[TAN]]および[[ATAN]]。

パラメータ:
- y (`decimal`): 点のy座標。
- x (`decimal`): 点のx座標。

戻り値: `decimal`として指定された2つの数値の商を正接とする角度を表す数値。

## 例
`ATAN2`は、点(2, 0)の正接の角度を取得します:
```sql
select atan2(0, 2)

--------
0
```
`ATAN2`は、点(0, -1)の正接の角度を取得し、小数点以下4桁に丸めます:
```sql
select round(atan2(-1, 0), 4)

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

