SIN() and COS() Function in SQL Server

1. SIN() Function :
The SIN() function returns the sine of a number.

Syntax :

SIN(number)

Parameter : Required. A numeric value.
number : It is a numeric value.
Returns : It returns the float_expression of the sine of a number.

Example-1 :
When the argument holds a positive number.

SELECT SIN(5);

Output :



-0.95892427466313845



Example-2 :
When the argument holds a negative number.

SELECT SIN(-5);

Output :

0.95892427466313845



Example-3 :
When the PI() function is the argument.

SELECT SIN(PI());

Output :

1.2246467991473532E-16



Example-4 :
When the argument passed is an expression.

SELECT SIN(4 * 3);

Output :

-0.53657291800043494


2. COS() Function
The COS() function returns the cosine of a number.



Syntax :

COS(number)

Parameter : Required. A numeric value.
number : It is a numeric value.
Returns : It returns the cosine of a number.

Example-1 :
When the argument holds a positive number.

SELECT COS(4);

Output :

-0.65364362086361194



Example-2 :
When the argument is a fractional component.

SELECT COS(2.53);

Output :

-0.81873459927738157



Example-3 :
When the PI() function is the argument.

SELECT COS(PI());

Output :

-1
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.