| title | ATN2 (Transact-SQL) | Microsoft Docs | |||
|---|---|---|---|---|
| ms.custom | ||||
| ms.date | 07/24/2017 | |||
| ms.prod | sql | |||
| ms.prod_service | database-engine, sql-database, sql-data-warehouse, pdw | |||
| ms.reviewer | ||||
| ms.technology | t-sql | |||
| ms.topic | language-reference | |||
| f1_keywords |
|
|||
| dev_langs |
|
|||
| helpviewer_keywords |
|
|||
| ms.assetid | 014b291e-7cd7-4c39-b20d-5db3a9f0505d | |||
| author | MashaMSFT | |||
| ms.author | mathoma | |||
| manager | craigg | |||
| monikerRange | >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDEtsql-appliesto-ss2008-all-md]
Returns the angle, in radians, between the positive x-axis and the ray from the origin to the point (y, x), where x and y are the values of the two specified float expressions.
Transact-SQL Syntax Conventions
ATN2 ( float_expression , float_expression ) float_expression
An expression of data type float.
float
The following example calculates the ATN2 for the specified x and y components.
DECLARE @x float = 35.175643, @y float = 129.44;
SELECT 'The ATN2 of the angle is: ' + CONVERT(varchar, ATN2(@y, @x));
GO [!INCLUDEssResult]
The ATN2 of the angle is: 1.30545
(1 row(s) affected) CAST and CONVERT (Transact-SQL)
float and real (Transact-SQL)
Mathematical Functions (Transact-SQL)