MySQL ASIN() Function

The ASIN() function in MySQL calculates the arcsine (inverse sine) of a number. The arcsine is the angle whose sine is equal to the given 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). It's crucial to remember that the input number 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 example calculates the arcsine of 0.25.

Syntax

SELECT ASIN(0.25);
      
Output

0.25268025224796
      

Calculating the Arcsine of a Negative Number

This example shows the arcsine of -0.8.

Syntax

SELECT ASIN(-0.8);
      
Output

-0.927295218001612
      

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