Open In App

Python | sympy.sin() method

Improve
Improve
Like Article
Like
Save
Share
Report

In sympy, the sin() method is a sine function. Using the sin(x) method in the sympy module, we can compute the sine of x.

Syntax : sympy.sin(x)
Return : Returns the sine of x 

Code #1: Below is the example using the sin() method to find the sine function. 

Python3




# importing sympy library
from sympy import *
 
# calling sin() method on expression
geek1 = sin(-1)
geek2 = sin(pi / 3)
geek3 = sin(pi)
 
print(geek1)
print(geek2)
print(geek3)


Output: 

-sin(1)
sqrt(3)/2
0

  Code #2: 

Python3




# importing sympy library
from sympy import *
 
 
# calling sin() method on expression
geek = sin(2 + 5j)
print(geek)


Output: 

67.4789152384559 - 30.8794313435882*I

Last Updated : 01 Feb, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads