SQL Tutorial SQL Advanced SQL Database SQL References

SQL Server - RADIANS() Function



The SQL Server (Transact-SQL) 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 (data type of returned value matches with x).

Example 1:

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

SELECT RADIANS(0);
Result: 0

SELECT RADIANS(30.0);
Result: 0.523598775598298816

SELECT RADIANS(60.0);
Result: 1.047197551196597631

SELECT RADIANS(90.0);
Result: 1.570796326794896558

SELECT RADIANS(180.0);
Result: 3.141592653589793116

SELECT RADIANS(-90.0);
Result: -1.570796326794896558

SELECT RADIANS(-180.0);
Result: -3.141592653589793116

Example 2:

Consider a database table called Sample with the following records:

Datax
Data 10.0
Data 230.0
Data 360.0
Data 490.0
Data 5180.0

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

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

This will produce the result as shown below:

DataxRADIANS_Value
Data 10.00.0
Data 230.00.523598775598298816
Data 360.01.047197551196597631
Data 490.01.570796326794896558
Data 5180.03.141592653589793116

❮ SQL Server Functions

5