Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 2.14 KB

atn2-transact-sql.md

File metadata and controls

65 lines (50 loc) · 2.14 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs monikerRange
ATN2 (Transact-SQL)
ATN2 (Transact-SQL)
markingmyname
maghan
07/24/2017
sql
t-sql
reference
ATN2
ATN2_TSQL
arctangent
tangent
ATN2 function
TSQL
>= aps-pdw-2016 || = azuresqldb-current || = azure-sqldw-latest || >= sql-server-2016 || >= sql-server-linux-2017 || = azuresqldb-mi-current||=fabric

ATN2 (Transact-SQL)

[!INCLUDE sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw]

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.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

ATN2 ( float_expression , float_expression )  

[!INCLUDEsql-server-tsql-previous-offline-documentation]

Arguments

float_expression
An expression of data type float.

Return types

float

Examples

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)  

See also

CAST and CONVERT (Transact-SQL)
float and real (Transact-SQL)
Mathematical Functions (Transact-SQL)