MariaDB SIN() Function

In MariaDB, SIN() is a built-in numeric function that returns the sine of a given value in radians.

MariaDB SIN() Syntax

Here is the syntax of the MariaDB SIN() function:

SIN(number)

Parameters

number

Required. A radian value used to calculate the sine.

If you provide the wrong number of parameters, MariaDB will report an error: ERROR 1582 (42000): Incorrect parameter count in the call to native function 'SIN'.

Return value

The MariaDB SIN() function returns the sine of the specified number.

If any parameter number is NULL, the SIN() function will return NULL.

MariaDB SIN() Examples

This statement shows the basic usage of the MariaDB SIN() function:

SELECT
    SIN(2.5),
    SIN(0.2),
    SIN(-0.5),
    SIN(-0.2),
    SIN(0),
    SIN(PI()),
    SIN(NULL)\G

Output:

 SIN(2.5): 0.5984721441039565
 SIN(0.2): 0.19866933079506122
SIN(-0.5): -0.479425538604203
SIN(-0.2): -0.19866933079506122
   SIN(0): 0
SIN(PI()): 1.2246467991473532e-16
SIN(NULL): NULL

Conclusion

In MariaDB, SIN() is a built-in numeric function that returns the sine of a given value in radians.