SQLite Tutorial SQLite Advanced SQLite Database SQLite References

SQLite RADIANS() Function



The SQLite RADIANS() function returns an angle measured in degrees to an approx. equivalent angle measured in radians.

Syntax

RADIANS(x)

Parameters

x Required. Specify an angle in degrees.

Return Value

Returns the angle measured in radians.

Example 1:

The example below shows the usage of RADIANS() function.

SELECT RADIANS(0);
Result: 0.0

SELECT RADIANS(30);
Result: 0.523598775598299

SELECT RADIANS(60);
Result: 1.0471975511966

SELECT RADIANS(90);
Result: 1.5707963267949

SELECT RADIANS(180);
Result: 3.14159265358979

SELECT RADIANS(-90);
Result: -1.5707963267949

SELECT RADIANS(-180);
Result: -3.14159265358979

Example 2:

Consider a database table called Sample with the following records:

Datax
Data 10
Data 230
Data 360
Data 490
Data 5180

The statement given below can be used to convert the records of column x (containing values expressed in degrees) into radians.

SELECT *, RADIANS(x) AS RADIANS_Value FROM Sample;

This will produce the result as shown below:

DataxRADIANS_Value
Data 100.0
Data 2300.523598775598299
Data 3601.0471975511966
Data 4901.5707963267949
Data 51803.14159265358979

❮ SQLite Functions