SQL ASIN Function

Savigo
You organize your data. Now organize your savings.
Set savings goals, track your progress, and stay on course.
Get Savigo for iPhone 

The SQL ASIN function returns the arcsin of an input numeric expression.

In math, arcsin(x) is the inversion of the sine of x where -1 <= x <= 1. It means that  arcsin(x) = sin-1(x).

Syntax #

The following shows the syntax of the ASIN function.

ASIN(numeric_expression)

Arguments #

The ASIN function accepts a numeric_expression that evaluates to a floating-point number in the range -1 and 1.

Return Type #

The ASIN function returns a floating-point number in radians.

Examples #

The following example returns the arcsin of 0.5 and 1.

SELECT 
   ASIN(0.5) angle_1_radians,
   ASIN(1) angle_2_radians;

Output:

  angle_1_radians   |  angle_2_radians
--------------------+--------------------
 0.5235987755982989 | 1.5707963267948966

To see the degrees value, you use the DEGREES function.

SELECT 
   DEGREES(ASIN(0.5)) angle_1_degrees,
   DEGREES(ASIN(1)) angle_2_degrees;
  angle_1_degrees   | angle_2_degrees
--------------------+-----------------
 30.000000000000004 |              90

Most database systems support the ASIN function.

Was this helpful?