MySQL RADIANS function is one of the Numeric Functions, which converts the degree values into radians. The basic syntax of the RADIANS in MySQL is as shown below:
SELECT RADIANS (Numeric_Expression) FROM Source
To demonstrate this Numeric function, we are going to use the below shown data
MySQL RADIANS Function Example
The MySQL convert 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.
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`;