Skip to content

Latest commit

 

History

History
89 lines (69 loc) · 2.62 KB

File metadata and controls

89 lines (69 loc) · 2.62 KB
title ATN2 (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 07/24/2017
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
ATN2
ATN2_TSQL
dev_langs
TSQL
helpviewer_keywords
arctangent
tangent
ATN2 function
ms.assetid 014b291e-7cd7-4c39-b20d-5db3a9f0505d
caps.latest.revision 36
author BYHAM
ms.author rickbyh
manager jhubbard

ATN2 (Transact-SQL)

[!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.

Topic link icon Transact-SQL Syntax Conventions

Syntax

-- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse  
  
ATN2 ( float_expression , float_expression )  

Arguments

float_expression Is an expression of the float data type.

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(@x,@y ));  
GO  

[!INCLUDEssResult]

The ATN2 of the angle is: 0.265345                         
(1 row(s) affected)  

Examples:

[!INCLUDEssSDWfull] and [!INCLUDEssPDW]

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(@x,@y ));  
GO  

[!INCLUDEssResult]

The ATN2 of the angle is: 0.265345                         
(1 row(s) affected)  

See also

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