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.
Name, Required /Optional, Description
X , Required, Double , It represents a valid number.
Return, Description
NULL, if the argument is NULL.
Double, It returns converting degree value of argument X passed as radians.
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)
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)
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)
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)
When it comes to children, there’s one universal truth: the right toy can spark imagination, build skills, and make memories…
In today’s digital age, where screens and gadgets dominate our children’s lives, there’s something heartwarming about a well-loved plush toy…
In a world dominated by screens and fast-paced routines, it’s easy to forget the simple magic of a toy in…
In the heart of Delhi’s vibrant streets lies a world where imagination meets innovation — the magical universe of toys.…
When was the last time a toy truly amazed you—not just as a product, but as a thoughtful tool for…
In the digital age, the way we experience childhood has changed, but the essence remains the same—imagination, exploration, and joy.…