SQL Server ASIN() Function

The ASIN() function in SQL Server calculates the arcsine (inverse sine) of a number. The arcsine is the angle whose sine is equal to the input number. The result is an angle expressed in radians.



ASIN(): Definition and Usage

ASIN() is a mathematical function primarily used in trigonometry and related fields. It's the inverse of the SIN() function; given the sine of an angle, ASIN() returns the angle itself (in radians). The input value must be between -1 and 1 (inclusive); otherwise, the function returns NULL.

Syntax

Syntax

ASIN(number)
      

Parameter Values

Parameter Description
number The numeric value representing the sine of an angle (must be between -1 and 1). This is required.

Examples

Calculating the Arcsine of a Positive Number

This calculates the arcsine of 0.25.

Syntax

SELECT ASIN(0.25);
      
Output

0.25268025224796 (Result in radians)
      

Calculating the Arcsine of a Negative Number

This example shows the arcsine of -0.8.

Syntax

SELECT ASIN(-0.8);
      
Output

-0.927295218001612 (Result in radians)
      

**Note:** The output values are approximate and expressed in radians. The exact value may vary slightly based on your SQL Server version and system's floating-point precision. If you provide a number outside the range -1 to 1, the result will be `NULL`.