TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

MySQL

MySQL Trigonometry Functions

Overview

In this tutorial, we will learn about MySQL trigonometry functions with examples. MySQL supports many in built functions.

Geometry functions

Let’s understand some basic geometry functions before trigonometry functions.

MySQL Geometry Function
Description
PI() This function returns the value of pi.
DEGREES(X)

 

This function returns the value of X, converted from radians to degrees.

radians -> degrees

RADIANS(X) This function returns the value of X, converted from degrees to radians.

degrees -> radians

 

mysql> SELECT PI();
+———-+
| PI() |
+———-+
| 3.141593 |
+———-+

mysql> SELECT DEGREES(PI());
+—————+
| DEGREES(PI()) |
+—————+
| 180 |
+—————+

MySQL Trigonometry Functions

Some of the functions are listed below:

MySQL Trigonometry Function
Description
COS(X) The function returns the cosine of X, where X is given in radians.
SIN(X)

 

The function returns the sine of X, where X is given in radians.
TAN(X)

 

The function returns the tangent of X, where X is given in radians.
COT(X)

 

The function returns the cotangent of X, where X is given in radians.
ACOS(X) This function returns the arc cosine of X, that is, the value whose cosine is X. It returns NULL if X is not in the range -1 to 1.
ASIN(X) The function returns the arc sine of X, that is, the value whose sine is X. It returns NULL if X is not in the range -1 to 1.
ATAN(X) The function returns the arc tangent of X, that is, the value whose tangent is X.
ATAN2(X,Y) The function returns the arc tangent of the two variables X and Y. The signs of both arguments are used to determine the quadrant of the result.

Examples

mysql> SELECT COS(PI()/4);
+——————–+
| COS(PI()/4) |
+——————–+
| 0.7071067811865476 |
+——————–+

mysql> SELECT TAN(PI()/4);
+——————–+
| TAN(PI()/4) |
+——————–+
| 0.9999999999999999 |
+——————–+

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Related Posts

MySQL /

Launch DataGrip on Windows

MySQL /

Install DataGrip IDE on Windows 11

MySQL /

New MySQL Connection in Workbench

MySQL /

Command-Line MySQL Client

MySQL /

Start MySQL Client on Windows 11

‹ MySQL TRIM Function› MySQL CHAR_LENGTH Function

Recent Posts

  • Scaler Academy – An Online Learning Platform
  • Difference between PHP and JavaScript?
  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com