SQL ASIN 函式返回輸入數值表示式的反正弦值。
在數學中,arcsin(x) 是 x 的正弦函式的反函式,其中 -1 <= x <= 1。這意味著 arcsin(x) = sin-1(x)。
語法 #
下面展示了 ASIN 函式的語法。
ASIN(numeric_expression)Code language: SQL (Structured Query Language) (sql)引數 #
ASIN 函式接受一個 numeric_expression(數值表示式),其計算結果為一個介於 -1 和 1 之間的浮點數。
返回型別 #
ASIN 函式返回一個以弧度為單位的浮點數。
示例 #
以下示例返回 0.5 和 1 的反正弦值。
SELECT
ASIN(0.5) angle_1_radians,
ASIN(1) angle_2_radians;Code language: SQL (Structured Query Language) (sql)輸出
angle_1_radians | angle_2_radians
--------------------+--------------------
0.5235987755982989 | 1.5707963267948966Code language: SQL (Structured Query Language) (sql)要檢視角度值,您可以使用 DEGREES 函式。
SELECT
DEGREES(ASIN(0.5)) angle_1_degrees,
DEGREES(ASIN(1)) angle_2_degrees;Code language: SQL (Structured Query Language) (sql) angle_1_degrees | angle_2_degrees
--------------------+-----------------
30.000000000000004 | 90Code language: SQL (Structured Query Language) (sql)大多數資料庫系統都支援 ASIN 函式。
本教程是否有幫助?