w3resource

MySQL COS() function

COS() function

MySQL COS() returns the cosine of a number where the number is given in radians.

This function is useful in -

  • COS() is a fundamental trigonometric function used in mathematics, engineering, physics, and various scientific fields.
  • In physics and engineering, COS() is used in the analysis of periodic waveforms.
  • COS() is vital in fields like signal processing and electrical engineering for analyzing harmonic components in waveforms.
  • In control systems engineering, COS() is used to model dynamic systems, especially those exhibiting oscillatory behavior.
  • In computer graphics and animation, COS() is used to create smooth transitions and animations by manipulating angles and rotations.
  • In electrical engineering, COS() is crucial for understanding and analyzing alternating current (AC) circuits, which are fundamental in power distribution.
  • COS() is utilized in the study of vibrations, oscillations, and wave propagation in various physical systems.

Syntax:

COS(N);

Argument:

Name Description
N A number whose cosine value is to be retrieved.

Syntax Diagram:

MySQL COS() Function - Syntax Diagram

MySQL Version: 8.0


Example

Code:

SELECT COS(1);

Explanation:

The above MySQL statement will return the cosine of the number specified as an argument.

Output:

mysql> SELECT COS(1);
+------------------+
| COS(1)           |
+------------------+
| 0.54030230586814 | 
+------------------+
1 row in set (0.01 sec)

All Mathematical Functions

Previous:CONV()
Next: COT()



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/mysql/mathematical-functions/mysql-cos-function.php