MySQL ATAN function is one of the Numeric Function which is used to calculate the trigonometric Arc Tangent of the specified expression. Arc tangent is also called as inverse of a Tangent, Please refer TAN Function to understand the Tangent Function. In this article we will show you, How to find Arc tangent value in MySQL using Command Prompt, and Workbench with example.
MySQL ATAN Syntax
The basic syntax of the ATAN in MySQL is as shown below:
SELECT ATAN (Numeric_Expression)
To demonstrate this ATAN Numeric function, we are going to use the below shown data
MySQL ATAN Function Example 1
The ATAN Function is used to return the trigonometric Arc tangent values for any numeric data. The following MySQL query will show multiple ways to use ATAN function.
-- MySQL ATAN Function Example
-- Arc Tangent of Negative Value
SELECT ATAN(-2.54) AS `Arc Tangent Value`;
-- Arc Tangent of Positive Value
SELECT ATAN(0.52) AS `Arc Tangent Value`;
-- Arc Tangent of Numeric Expression
SELECT ATAN(4.25 + 7.75 - 9.25) AS `Arc Tangent Value`;
-- Arc Tangent of string value
SELECT ATAN('1.35') AS `Arc Tangent Value`;
-- Arc Tangent of String
SELECT ATAN('MySQL') AS `Arc Tangent Value`;
As you can see, we used ATAN function to find the ArcTangent of different values. And, we assigned a new name to the result as ‘Arc Tangent Value’ using ALIAS Column.
MySQL ATAN Example 2
In MySQL, ATAN Numeric Function also allows you to find the arc tangent of the data inside a table. In this example, we are going to find the arc tangent (or inverse of a tangent) for all the records present in Service Grade column.
-- MySQL Arc Tangent Example
SELECT Product, Color,
StandardCost, Sales, TaxAmt,
ATAN(ServiceGrade) AS `Arc Tangent Value`
FROM `numeric functions`;
Thank You for Visiting Our Blog