×

MySQL TAN() Function

Basically, the TAN() function in MySQL is used to give back the tangent of a mentioned number.
In any kind of right-angle triangle, the tangent of an angle is the length of the opposite side divided by the length of the adjacent side. Similarly, the tangent of y can also be defined as the sine of y divided by the cosine of y, where y is the specified angle.

Syntax of the MySQL TAN() function:

The syntax of the MySQL TAN() function is given as follows:
TAN(num);

Parameters or arguments used in MySQL TAN() function:

Only one parameter is accepted by the TAN() function in MySQL, which is given as follows:

Number: It is the number which we want to calculate the tangent value of the number.

Returns: It will return the tangent of that mentioned number.

Application used for TAN() function:

The TAN() function can be used in the given below MySQL versions.:

  • MySQL 5.7
  • MySQL 5.6
  • MySQL 5.5
  • MySQL 5.1
  • MySQL 5.0
  • MySQL 4.1
  • MySQL 4.0
  • MySQL 3.23

Examples of MySQL TAN() function:

Now we will look into some MySQL TAN() function examples and will explore how to use the TAN function in MySQL.

Example 1:
Here, we will derive the tangent value of 1 using the TAN() function in MySQL.

SELECT TAN( 1) as TAN_ value ;

Output:

TAN_ value
1.5574077246549023
1 row in set (0.00 sec)

Example 2:

Here, we will derive the tangent value of 0 using the TAN() function in MySQL.

SELECT TAN(0) as TAN_ value ;

Output:

TAN_ value
0
1 row in set (0.00 sec)

Example 3:

Now we will derive the tangent value of -3 using the TAN() function in MySQL.

SELECT TAN(-3) as TAN_ value ;

Output:

TAN_ value
0.1425465430742778
1 row in set (0.00 sec)

Example 4:

Now we will derive the tangent value of 3 using the TAN() function in MySQL.

SELECT TAN(3) as TAN_ value ;

Output:

TAN_ value
-0.1425465430742778
1 row in set (0.00 sec)

Example 5:

Now we will derive the tangent value of 0.75 using the TAN() function in MySQL.

SELECT TAN(0.75) as TAN_ value ;

Output:

TAN_ value
0.9315964599440725
1 row in set (0.00 sec)

Example 6:

Now we will derive the tangent value of 8 using the TAN() function in MySQL.

SELECT TAN(8) as TAN_ value ;

Output:

TAN_ value
-6.799711455220379
1 row in set (0.00 sec)

Example 7:

You can also pass the pi() function as a value to the TAN() function, as shown below:

SELECT TAN(pi()) as TAN_ value;

Output:

TAN_ value
-1.2246467991473532e-16
1 row in set (0.00 sec)

Example 8:

Following is another example of the TAN() function in MySQL in which we will derive the tangent value of -16.

SELECT TAN(-16) as TAN_ value ;

Output:

TAN_ value
-0.3006322420239034
1 row in set (0.00 sec)

Application of MySQL TAN() function:

This function is used to return the tangent of a mentioned number.

Summary:

In the above context, we have learned how we can use the TAN () function in MySQL to calculate the tangent value of the specified number.


Related Topics

MySQL Constraints

MySQL Constraints Introduction The constraints help to restrict what values should be stored in a table. The constraints provide limitations of the columns or data. This function helps to insert data in...

20 minutes read.

MySQL CURRENT_DATE() Function

In this context, we will learn how we can use the MySQL CURRENT_DATE() function to get the current date, and we will see in the two formats, such as strings...

2 minutes read.

MySQL LOCATE() function

In this context, we will learn how we can use the MySQL LOCATE() function with proper syntax and good examples. Introduction of MySQL LOCATE() function LOCATE() function in MySQL is used for...

3 minutes read.

MySQL Table

Introduction MySQL table is an essential part of the system. MySQL table stores data using index, rows, and columns. It accesses data from the server quickly because of the table—this table...

22 minutes read.

MySQL SOUNDEX() function

In this context, we will learn how we can use the MySQL SOUNDEX() function with proper syntax and good examples. Introduction of MySQL SOUNDEX() function SOUNDEX() function in MySQL is used to...

3 minutes read.

MySQL ROUND() function

In this context, we will learn how we can use the MySQL ROUND() function with proper syntax and good examples. Introduction of MySQL ROUND() function The ROUND() function in MySQL is used...

3 minutes read.

MySQL INSERT() Function

In this context, we will learn how we can use the MySQL INSERT() function with proper syntax and good examples. Introduction of MySQL INSERT() function Basically, in MySQL, the INSERT function is...

2 minutes read.

MySQL ISNULL function

This function is used to check the null value in table data. It returns the result in a Boolean form. If table data is null, then the output becomes 1....

2 minutes read.

MySQL AVG function

This function works on numerical data type values. The average function shows the average value of the data set. If an average function returns a null value, then the row...

5 minutes read.

MySQL REVERSE() function

In this context, we will learn how we can use the MySQL REVERSE() function with proper syntax and good examples. Introduction of MySQL REVERSE() function This function could be used to reverse...

2 minutes read.

MySQL Subquery

The subquery is a MySQL query used to manage data operations. Mainly subquery helps to retrieve data with the necessary condition. It creates a nested query with two different queries....

5 minutes read.

MySQL FROM_BASE64() function

In this context, we will learn how we can use the MySQL FROM_BASE64()() function with proper syntax and good examples. Introduction of MySQL FROM_BASE64()() function Basically, the FROM_BASE64() function In MySQL decodes...

2 minutes read.

MySQL PI() function

In this context, we will learn how we can use the MySQL PI() function with proper syntax and good examples. Introduction of MySQL PI() function PI() function in MySQL is used to...

2 minutes read.

MySQL RTRIM() function

In this context, we will learn how we can use the MySQL RTRIM() function with proper syntax and good examples. Introduction of MySQL RTRIM() function It is the function in MySQL that...

2 minutes read.

MySQL RPAD() function

In this context, we will learn how we can use the MySQL RPAD() function with proper syntax and good examples. Introduction of MySQL RPAD() function RPAD() function in MySQL is used to...

2 minutes read.

MySQL ASIN() Function

In this context we will learn how we can use the ASIN() function in MySQL with proper syntax and good example. Introduction of MySQL ASIN() function The arc sine value of a...

2 minutes read.

MySQL logical conditions

MySQL logical conditions Introduction MySQL handles data with clauses, operators, and conditions. The logical condition is used to compare information and returns the required output. This condition applies logic to MySQL expressions...

7 minutes read.

MySQL Control flow function

The control flow function uses values or operands for logical operations. These functions can works on single and multiple conditions. The control flow function is based on the Boolean expression....

3 minutes read.

MySQL Operators

MySQL Operators MySQL operator needs advanced operation on the table and its data. This operator works with the "WHERE" clause. MySQL operators are a statement to modify information. It helps to...

13 minutes read.

MySQL FIND_IN_SET() function

In this context, we will learn how we can use the MySQL MOD() function with proper syntax and good examples. Introduction of MySQL MOD() function MySQL provides a built-in string function called...

4 minutes read.