Python | sympy.cos() method
Last Updated :
30 Jan, 2023
In sympy, cos() method is cosine function. Using the cos(x) method in the sympy module, we can compute the cosine of x.
Syntax : sympy.cos(x)
Return : Returns the cosine of x
Code #1: Below is the example using cos() method to find cosine function.
Python3
from sympy import *
geek1 = cos( - 1 )
geek2 = cos(pi / 3 )
geek3 = cos(pi)
print (geek1)
print (geek2)
print (geek3)
|
Output:
cos(1)
1/2
-1
Code #2:
Python3
from sympy import *
geek = cos( 2 + 5j )
print (geek)
|
Output:
-30.8822353189167 - 67.4727884405875*I
Share your thoughts in the comments
Please Login to comment...