The atan() is a Math function of MySQL. This function is used to get the arc tangent of the given number.
In MySQL, the ATAN function is used to find the arc tangent of a given angle or a specified expression. It is also called the inverse of a tangent. In this article, we will explore the concept of the MySQL ATAN() function in detail along with its various practical examples.
Num: It is the number to get arc tangent.
This function returns the arc tangent of the given number.
Explanation: On the execution of above query, the atan() function calculates the arc tangent of the value 0.45.
Output: The output of this example is given below.

Explanation: On execution of the above query, the atan() function is used to calculate the arctangent value of two arguments i.e. 0.4, and 5. It returns the arctangent value of 0.4/5.
Output: The output of this example is given below.

Explanation: On execution of the above query, in the ATAN() function, we can pass the PI() function as an argument, which returns the tangent value.
Output: The output of this example is given below.
| RESULT |
| 1.0038848218538872 |
The MySQL ATAN function is used to find the arctangent value of given column value.
Follow the steps given below to perform the MySQL ATAN() functionality in a table column.
Step 1: First, create a table named Math_Figure using the CREATE TABLE statement.
Step 2: After that INSERT data into a table using the INSERT TABLE statement.
Step 3: To check the information with the use of SELECT statement, whether the data is inserted or not.
| ID | Diagram | Angle | Sin_Value | Cosine_Value |
|---|---|---|---|---|
| 1 | ABC | 0.523599 | 0.5 | 0.866025 |
| 2 | PQR | 0.785398 | 0.707107 | 0.707107 |
| 3 | RST | 1.309 | 0.965927 | 0.258816 |
| 4 | DEF | 1.5708 | 1 | -000036199 |
Explanation: On execution of the above statement, the ATAN function is used to return the tangent value of the Angle column in a table.
Output: The output of this example is given below.
| ID | Diagram | Angle | Sin_Value | Cosine_Value | ATAN_VALUE |
|---|---|---|---|---|---|
| 1 | ABC | 0.523599 | 0.5 | 0.866025 | 0.48234810565526803 |
| 2 | PQR | 0.785398 | 0.707107 | 0.707107 | 0.6657736529518009 |
| 3 | RST | 1.309 | 0.965927 | 0.258816 | 0.9184319297428947 |
| 4 | DEF | 1.5708 | 1 | -000036199 | 1.003885865858903 |
In a MySQL table, we can also find the arctangent of an angle by dividing the sine value of an angle by the cosine value of an angle.
Take the following example of Math_Figure Table which contains the following information.
| ID | Diagram | Angle | Sin_Value | Cosine_Value |
|---|---|---|---|---|
| 1 | ABC | 0.523599 | 0.5 | 0.866025 |
| 2 | PQR | 0.785398 | 0.707107 | 0.707107 |
| 3 | RST | 1.309 | 0.965927 | 0.258816 |
| 4 | DEF | 1.5708 | 1 | -000036199 |
Explanation: On execution of the above statement, the ATAN function is used to return the arctangent value of the Angle column.
Output: The output of this example is given below.
| ID | Diagram | Angle | Sin_Value | Cosine_Value | ATAN_VALUE |
|---|---|---|---|---|---|
| 1 | ABC | 0.523599 | 0.5 | 0.866025 | 0.48234810565526803 |
| 2 | PQR | 0.785398 | 0.707107 | 0.707107 | 0.6657736529518009 |
| 3 | RST | 1.309 | 0.A | 0.258816 | 0.9184319297428947 |
| 4 | DEF | 1.5708 | 1 | -000036199 | 1.003885865858903 |
The MySQL ATAN function is used to find the arctangent value of a given column value with restricted data using the WHERE clause.
Sample Table: Math_Figure
| ID | Diagram | Angle | Sin_Value | Cosine_Value |
|---|---|---|---|---|
| 1 | ABC | 0.523599 | 0.5 | 0.866025 |
| 2 | PQR | 0.785398 | 0.707107 | 0.707107 |
| 3 | RST | 1.309 | 0.965927 | 0.258816 |
| 4 | DEF | 1.5708 | 1 | -000036199 |
Explanation: On execution of the above statement, the ATAN function used to return the arctangent value from the Angle column in a Math_Figure table where the value of the ID column is greater than 1.
Output: The output of this example is given below.
| ID | Diagram | Angle | Sin_Value | Cosine_Value | ATAN_VALUE |
|---|---|---|---|---|---|
| 2 | PQR | 0.785398 | 0.707107 | 0.707107 | 0.6657736529518009 |
| 3 | RST | 1.309 | 0.965927 | 0.258816 | 0.9184319297428947 |
| 4 | DEF | 1.5708 | 1 | -000036199 | 1.003885865858903 |
We request you to subscribe our newsletter for upcoming updates.