SQL Server DEGREES() Function
The DEGREES()
function in SQL Server converts an angle measured in radians to its equivalent in degrees. This is a fundamental trigonometric function used for converting between different angular units.
DEGREES(): Definition and Usage
Radians and degrees are two common units for measuring angles. Radians are based on the radius of a circle, while degrees are based on dividing a circle into 360 parts. DEGREES()
is essential for converting calculations or data that uses radians into the more commonly understood degree format.
Related Functions
The RADIANS()
function performs the inverse conversion (degrees to radians), and the PI()
function provides the value of pi (π), which is frequently used in trigonometric calculations.
Syntax
Syntax
DEGREES(number)
Parameter Values
Parameter | Description |
---|---|
number |
The angle measured in radians. This is a required numeric value. |
Examples
Converting Radians to Degrees
This example converts 1.5 radians to degrees.
Syntax
SELECT DEGREES(1.5);
Output
85.9436692696235
Converting 2π Radians to Degrees
Converting 2π radians (a full circle) to degrees should result in 360.
Syntax
SELECT DEGREES(PI() * 2);
Output
360.000000000000