MySQL: COS Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL COS Function

In this guide, we will explain how to use the MySQL COS function with syntax and examples.

Description

The MySQL COS function returns the cosine of a number.

Syntax

The syntax for the COS function is:

COS( number )

Parameters or Arguments

number

The value is used to calculate the cosine. It is expressed in radians.

Applies To

The COS function can be used in the following 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

Example

Let’s look at some COS function examples and explore how to use the COS function.

For example:

mysql> SELECT COS(2);
Result: -0.4161468365471424

mysql> SELECT COS(PI());
Result: -1

mysql> SELECT COS(-0.9);
Result: 0.6216099682706644

Next Topic : Click Here

This Post Has One Comment

Leave a Reply