MySQL ATAN() Function

Last Updated : 26 Feb 2026

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.

Syntax

Parameters:

Num: It is the number to get arc tangent.

Returns

This function returns the arc tangent of the given number.

Example 1

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.

MySQL Math ATAN() Function

Example 2

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.

MySQL Math ATAN() Function

Example 3:

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

Using the MySQL ATAN() function in a Table

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.

IDDiagramAngleSin_ValueCosine_Value
1ABC0.5235990.50.866025
2PQR0.7853980.7071070.707107
3RST1.3090.9659270.258816
4DEF1.57081-000036199

Example:

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.

IDDiagramAngleSin_ValueCosine_ValueATAN_VALUE
1ABC0.5235990.50.8660250.48234810565526803
2PQR0.7853980.7071070.7071070.6657736529518009
3RST1.3090.9659270.2588160.9184319297428947
4DEF1.57081-0000361991.003885865858903

Using the MySQL ATAN() function ina Table with Sin Value and Cosine Value

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.

IDDiagramAngleSin_ValueCosine_Value
1ABC0.5235990.50.866025
2PQR0.7853980.7071070.707107
3RST1.3090.9659270.258816
4DEF1.57081-000036199

Example:

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.

IDDiagramAngleSin_ValueCosine_ValueATAN_VALUE
1ABC0.5235990.50.8660250.48234810565526803
2PQR0.7853980.7071070.7071070.6657736529518009
3RST1.3090.A0.2588160.9184319297428947
4DEF1.57081-0000361991.003885865858903

Using the MySQL ATAN() function in a Table column with a WHERE clause

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

IDDiagramAngleSin_ValueCosine_Value
1ABC0.5235990.50.866025
2PQR0.7853980.7071070.707107
3RST1.3090.9659270.258816
4DEF1.57081-000036199

Example:

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.

IDDiagramAngleSin_ValueCosine_ValueATAN_VALUE
2PQR0.7853980.7071070.7071070.6657736529518009
3RST1.3090.9659270.2588160.9184319297428947
4DEF1.57081-0000361991.003885865858903

Next TopicMySQL Math