In Python, a math module contains a number of math operations that can be easily accomplished using the module. math.sin()
returns the sine of the value passed as an argument. The value passed to this function must 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:
|
Output:
The value of sine of pi / 6 is: 0.49999999999999994
Code # 2:
|
Exit:
in_array: [-3.14159265, -2.57039399, -0.2855993 3, 0.28559933, 2.57039399, 3.14159265]
out_array: [-3.5897930298416118e-09, -0.5406408168673427, -0.2817325547837714, 0.2817325547837714, 0.540640816830e2984]
![]()