MySQL RADIANS Function

MySQL RADIANS function is one of the Numeric Functions, which converts the degree values into radians. The basic syntax of the MySQL RADIANS function is as shown below:

SELECT RADIANS (Numeric_Expression)
FROM Source

To demonstrate this Numeric function, we are going to use the below shown data

Source Table 1

MySQL RADIANS Function Example

It converts the degree value into radians. The following query shows multiple ways to use this.

-- Finding Radians Value for Negative Value
SELECT RADIANS(-620.75) AS `Value in Radians`;

-- Finding Radians Value for Positive Value
SELECT RADIANS(180.00) AS `Value in Radians`;

-- Finding Radians Value for string value
SELECT RADIANS('90.00') AS `Value in Radians`;

-- Finding Radians Value of a String
SELECT RADIANS('MySQL') AS `Value in Radians`;

From the below screenshot, you can see that we used this MySQL method on different values.

MySQL RADIANS Function Example

The Numeric Function also allows you to find the radian’s value for the column data. In this example, we are going to find the equivalent radians value for all the records present in the Standard Cost and Sales column.

SELECT Product, Color,
		StandardCost,
        RADIANS(StandardCost) AS `Cost in Radians`, 
        Sales, 
        RADIANS(Sales) AS `Sales in Radians`, 
        TaxAmt
FROM `numeric functions`;
MySQL RADIANS Example 3

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.