MariaDB RADIANS() Function

In MariaDB, RADIANS() is a built-in function that returns a given degree value converted to radians.

If you need to convert radians to degrees, use the DEGREES() function. See also the PI() function.

MariaDB RADIANS() syntax

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

RADIANS(number)

Parameters

number

Required. A number representing degrees.

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 'RADIANS'.

Return value

The MariaDB RADIANS() function returns the degree corresponding to the specified radian value.

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

MariaDB RADIANS() Examples

Example 1

SELECT RADIANS(0);

Output:

+------------+
| RADIANS(0) |
+------------+
|          0 |
+------------+

Example 2

SELECT RADIANS(180);

Output:

+-------------------+
| RADIANS(180)      |
+-------------------+
| 3.141592653589793 |
+-------------------+

Example 3

SELECT RADIANS(360);

Output:

+-------------------+
| RADIANS(360)      |
+-------------------+
| 6.283185307179586 |
+-------------------+

Example 4

SELECT RADIANS(-180);

Output:

+--------------------+
| RADIANS(-180)      |
+--------------------+
| -3.141592653589793 |
+--------------------+

Conclusion

In MariaDB, RADIANS() is a built-in function that returns a given degree value converted to radians.