ATAN (Transact-SQL)
以弧度傳回角度,其正切函數 (Tangent) 是指定之 float 運算式的角度。這也稱為反正切函數 (Arctangent)。
語法
ATAN ( float_expression )
傳回類型
float
範例
下列範例使用 float 運算式,且會傳回指定角度的 ATAN。
SELECT 'The ATAN of -45.01 is: ' + CONVERT(varchar, ATAN(-45.01))
SELECT 'The ATAN of -181.01 is: ' + CONVERT(varchar, ATAN(-181.01))
SELECT 'The ATAN of 0 is: ' + CONVERT(varchar, ATAN(0))
SELECT 'The ATAN of 0.1472738 is: ' + CONVERT(varchar, ATAN(0.1472738))
SELECT 'The ATAN of 197.1099392 is: ' + CONVERT(varchar, ATAN(197.1099392))
GO
以下為結果集:
-------------------------------
The ATAN of -45.01 is: -1.54858
(1 row(s) affected)
--------------------------------
The ATAN of -181.01 is: -1.56527
(1 row(s) affected)
--------------------------------
The ATAN of 0 is: 0
(1 row(s) affected)
----------------------------------
The ATAN of 0.1472738 is: 0.146223
(1 row(s) affected)
-----------------------------------
The ATAN of 197.1099392 is: 1.56572
(1 row(s) affected)