ATN2 (Transact-SQL)
以介於正數 X 軸和從原點到 (y, x) 點的切線之間的弧度來傳回角度,其中 x 與 y 是兩個指定浮點運算式的值。
適用於:SQL Server (SQL Server 2008 透過目前版本)、Windows Azure SQL 資料庫 (初始版本,透過目前版本)。 |
語法
ATN2 ( float_expression , float_expression )
引數
- float_expression
這是一個 float 資料類型的運算式。
傳回類型
float
範例
下列範例會計算指定的 x 和 y 元件的 ATN2。
DECLARE @x float = 35.175643, @y float = 129.44;
SELECT 'The ATN2 of the angle is: ' + CONVERT(varchar,ATN2(@x,@y ));
GO
以下為結果集:
The ATN2 of the angle is: 0.265345
(1 row(s) affected)