Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

sql
cos
communitycreator

What is COS() in SQL?

harris910

The COS() function returns the cosine of a number. To be more specific, it returns the cosine of a number in the radian float value.

Figure 1 shows the mathematical representation of the COS() function.

This COS() function only works for right-angled triangles.

Figure 1: Mathematical representation of cosine function

Syntax

COS(number)

Parameter

This function requires a number as a parameter.

Return Value

COS() returns the cosine of a number (radian float value) that is sent as a parameter.

Example

/*example showing how to use COS(X)*/

-- positive number
select COS(10);

-- negative number
select COS(-6);

-- fractional number
select COS(4.6);

RELATED TAGS

sql
cos
communitycreator
RELATED COURSES

View all Courses

Keep Exploring