PostgreSQL radians() Function

The PostgreSQL radians() function converts the specified value in degrees to radians and returns the result.

If you need to convert radians to degrees, use the degrees() function.

radians() Syntax

This is the syntax of the PostgreSQL radians() function:

radians(degrees) -> double precision

Parameters

degrees

Required. A radian value.

Return value

The PostgreSQL radians() function converts the specified value in degrees to radians and returns the result.

The radians() function will return NULL if the argument is NULL.

PostgreSQL will give an error if you supply a parameter that is not a numeric type.

radians() Examples

Here are a few examples of the radians() function:

SELECT
    radians(45) AS "radians(45)",
    radians(180) AS "radians(180)",
    radians(-180) AS "radians(-180)";
    radians(45)     |   radians(180)    |   radians(-180)
--------------------+-------------------+--------------------
 0.7853981633974483 | 3.141592653589793 | -3.141592653589793