Dofactory.com
Dofactory.com
Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

SQL COS Function

COS returns the cosine in radians of the specified angle.

COS, along with SIN and TAN, is one of the primary trigonometric functions.

Example

#

This example returns the cosine of the specified angle measured in radians.

SELECT COS(0) AS '0 degrees',
       COS(PI()/3) AS '60 degrees',
       COS(PI()) AS '180 degrees'
Result:  1 record
0 degrees 60 degrees 180 degrees
1 .5 -1

Note: PI is a function that returns the value of π (3.14).


Syntax

Syntax of the COS function.

COS(angle)

angle -- a number representing an angle in radians.


You may also like



Last updated on Dec 21, 2023

Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.