How to Convert radians to degrees using DEGREES() in MySQL8 ?

With MySQL, we can do complex calculations very easily with the help of inbuilt mathematical functions. DEGREES(X) helps in converting argument X, from radians to degrees.

Now let’s start with it.


DEGREES(X) is a mathematical function. It changes the input value in radians which are passed as the argument, to degrees.

It will return NULL, if X is passed as NULL.

It returns Error, if any String argument is passed as an input.


MySQL DEGREES() : Syntax

DEGREES ( X );

MySQL DEGREES() : Parameter

Name, Required /Optional, Description
X , Required, Double , It represents a valid number.


MySQL DEGREES() : Output

Return, Description
NULL, if the argument is NULL.
Double, It returns converting degree value of argument X passed as radians.


MySQL DEGREES()  Available from : MySQL 4.1


DEGREES() Example 1 : Basic Examples

Now, Let’s see some of the basic examples of it and see what it returns.

mysql> SELECT DEGREES(500);
+-------------------+
| DEGREES(500) |
+-------------------+
| 28647.88975654116 |
+-------------------+
1 row in set (0.00 sec)

mysql> SELECT DEGREES(2.5);
+-------------------+
| DEGREES(2.5) |
+-------------------+
| 143.2394487827058 |
+-------------------+
1 row in set (0.04 sec)

mysql> SELECT DEGREES(12.5);
+-------------------+
| DEGREES(12.5) |
+-------------------+
| 716.1972439135291 |
+-------------------+
1 row in set (0.00 sec)

DEGREES() Example 2 : Using it with PI()

We are using the PI() function to get the value of DEGREES() of it. I get the below value.

mysql> SELECT DEGREES(PI());
+---------------+
| DEGREES(PI()) |
+---------------+
| 180 |
+---------------+
1 row in set (0.07 sec)

DEGREES() Example 3 : Using it Expressions

We are using the PI() function to get the value of DEGREES() of it. I get the below value.

mysql> SELECT DEGREES(PI()/2); 
+-----------------+ 
| DEGREES(PI()/2) | 
+-----------------+ 
| 90 |
+-----------------+
1 row in set (0.05 sec)
mysql> SELECT DEGREES(PI()*2);
+-----------------+
| DEGREES(PI()*2) |
+-----------------+
| 360 |
+-----------------+
1 row in set (0.00 sec)

mysql> SELECT DEGREES(PI()/4);
+-----------------+
| DEGREES(PI()/4) |
+-----------------+
| 45 |
+-----------------+
1 row in set (0.00 sec)

DEGREES() Example 4 : NULL arguments

If the argument is NULL, it will return NULL. See the below example :

mysql> SELECT DEGREES(NULL);
+---------------+
| DEGREES(NULL) |
+---------------+
| NULL |
+---------------+
1 row in set (0.01 sec)

Related articles : PI(), MySQL Maths.

jyoti rani

Recent Posts

Modern Toys, Magical Moments: Why the Best Toy Shop in Noida Is More Than Just a Store

When it comes to children, there’s one universal truth: the right toy can spark imagination, build skills, and make memories…

6 months ago

Rediscovering Joy: A New Era of Creativity & Comfort in Toy Stores

In today’s digital age, where screens and gadgets dominate our children’s lives, there’s something heartwarming about a well-loved plush toy…

6 months ago

Unboxing Imagination: Discovering the Joy of Play at a Toy Store in Noida

In a world dominated by screens and fast-paced routines, it’s easy to forget the simple magic of a toy in…

6 months ago

Imagination Unboxed: Discover Joy at the Toy Shop in Delhi

In the heart of Delhi’s vibrant streets lies a world where imagination meets innovation — the magical universe of toys.…

6 months ago

Play with Purpose: Discovering the Ultimate Toy Store in Noida

When was the last time a toy truly amazed you—not just as a product, but as a thoughtful tool for…

6 months ago

From Tears to Toys: Exploring Modern Childhood through Delhi’s Favorite Toy Shop

In the digital age, the way we experience childhood has changed, but the essence remains the same—imagination, exploration, and joy.…

6 months ago