ASIN (Transact-SQL)

指定された float 型の式がサイン (正弦) となる角度をラジアンで返します。これは、アークサイン (逆正弦) とも呼ばれます。

トピック リンク アイコンTransact-SQL 構文表記規則

構文

ASIN ( float_expression )

引数

  • float_expression
    float 型の、または暗黙的に float 型に変換できる式です。有効な値の範囲は -1 ~ 1 です。この範囲外の値を指定すると、NULL が返され、ドメイン エラーが発生します。

戻り値の型

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)