Python | math.sin() function Last Updated : 20 Mar, 2019 Comments Improve Suggest changes Like Article Like Report In Python, math module contains a number of mathematical operations, which can be performed with ease using the module. math.sin() function returns the sine of value passed as argument. The value passed in this function should be in radians. Syntax: math.sin(x) Parameter: x : value to be passed to sin() Returns: Returns the sine of value passed as argument Code #1: Python3 1== # Python code to demonstrate the working of sin() # importing "math" for mathematical operations import math a = math.pi / 6 # returning the value of sine of pi / 6 print ("The value of sine of pi / 6 is : ", end ="") print (math.sin(a)) Output: The value of sine of pi/6 is : 0.49999999999999994 Code #2: Python3 1== # Python program showing # Graphical representation of # sin() function import math import matplotlib.pyplot as plt in_array = [-3.14159265, -2.57039399, -0.28559933, 0.28559933, 2.57039399, 3.14159265] out_array = [] for i in range(len(in_array)): out_array.append(math.sin(in_array[i])) i += 1 print("in_array : ", in_array) print("\nout_array : ", out_array) # red for numpy.sin() plt.plot(in_array, out_array, color = 'red', marker = "o") plt.title("math.sin()") plt.xlabel("X") plt.ylabel("Y") plt.show() Output: in_array : [-3.14159265, -2.57039399, -0.28559933, 0.28559933, 2.57039399, 3.14159265] out_array : [-3.5897930298416118e-09, -0.5406408168673427, -0.2817325547837714, 0.2817325547837714, 0.5406408168673427, 3.5897930298416118e-09] Comment More infoAdvertise with us Next Article Python | math.sin() function S Shivam_k Follow Improve Article Tags : Python Python math-library-functions Practice Tags : python Similar Reads Python | math.tan() function In Python, math module contains a number of mathematical operations, which can be performed with ease using the module. math.tan() function returns the tangent of value passed as argument. The value passed in this function should be in radians. Syntax: math.tan(x) Parameter: x : value to be passed t 2 min read Python - math.asin() function Math module contains a number of functions which is used for mathematical operations. The math.asin() function returns the arc sine value of a number. The value passed in this function should be between -1 to 1. Syntax: math.asin(x) Parameter:This method accepts only single parameters. x :This param 2 min read Python - cmath.sin() function cmath is Python built-in module that is used for complex number mathematics. cmath module has a method sin() that returns sine of the complex number passed to it. Syntax: cmath.sin(Z) Parameter: It requires only one parameter i.e the number for which sine needs to be calculated. Return: Returns a co 1 min read Python - cmath.sinh() function cmath is python built-in module that is used for complex number mathematics. cmath module has a method sinh() that returns hyperbolic sine of the complex number passed to it. Syntax: cmath.sinh(Z) Parameter: It requires only one parameter i.e the number for which hyperbolic sine needs to be calculat 1 min read math.cos() in Python math.cos() function in Python is part of the built-in math module, which provides access to mathematical functions. The math.cos() function is used to calculate the cosine of an angle, which is a fundamental trigonometric function widely used in various fields like physics, engineering and computer 2 min read numpy.sin() in Python numpy.sin(x[, out]) = ufunc 'sin') : This mathematical function helps user to calculate trigonometric sine for all x(being the array elements). Parameters : array : [array_like]elements are in radians. 2pi Radians = 36o degrees Return : An array with trigonometric sine of x for all x i.e. array elem 1 min read numpy.sinc() in Python numpy.sinc(array) : This mathematical function helps user to calculate sinc function for all x(being the array elements). Parameters : array : [array_like] elements are in radians. 2pi Radians = 36o degrees Return : An array with sinc value of x for all x i.e. array elements. Code #1 : Working Pytho 1 min read numpy.sinh() in Python The numpy.sinh() is a mathematical function that helps user to calculate hyperbolic sine for all x(being the array elements). Equivalent to 1/2 * (np.exp(x) - np.exp(-x)) or -1j * np.sin(1j*x). Syntax: numpy.sinh(x[, out]) = ufunc 'sin') Parameters : array : [array_like] elements are in radians. 2pi 2 min read sympy.cot() method In Python The cotangent of an angle is defined as the length of the adjacent sides of an angle divided by the length of the opposite side of the angle. The Sympy cot() function in Python is a trigonometric function that is used to find the value of cot theta. In this article, we will see how the cot() functio 2 min read atan2() function in Python atan2(y, x) returns value of atan(y/x) in radians. The atan2() method returns a numeric value between -\pi and \pi representing the angle \theta of a (x, y) point and positive x-axis. Syntax : atan2(y, x) Parameter : (y, x) - Both must be a numeric value. Returns : Returns atan(y / x), in radians. T 2 min read Like