ASIN (Transact-SQL)
傳回其正弦函數 (Sine) 是指定 float 運算式的角度 (以弧度為單位)。這也稱為反正弦函數 (Arcsine)。
語法
ASIN ( float_expression )
傳回類型
float
範例
下列範例會使用 float 運算式,且會傳回指定角度的 ASIN。
/* The first value will be -1.01. This fails because the value is
outside the range.*/
DECLARE @angle float
SET @angle = -1.01
SELECT 'The ASIN of the angle is: ' + CONVERT(varchar, ASIN(@angle))
GO
-- The next value is -1.00.
DECLARE @angle float
SET @angle = -1.00
SELECT 'The ASIN of the angle is: ' + CONVERT(varchar, ASIN(@angle))
GO
-- The next value is 0.1472738.
DECLARE @angle float
SET @angle = 0.1472738
SELECT 'The ASIN of the angle is: ' + CONVERT(varchar, ASIN(@angle))
GO
以下為結果集:
-------------------------
.Net SqlClient Data Provider: Msg 3622, Level 16, State 1, Line 3
A domain error occurred.
---------------------------------
The ASIN of the angle is: -1.5708
(1 row(s) affected)
----------------------------------
The ASIN of the angle is: 0.147811
(1 row(s) affected)