In Python, a math module contains a number of math operations that can be easily accomplished using the module. math.cos()
returns the cosine of the value passed as an argument. The value passed to this function must be in radians.
Syntax: math.cos (x)
Parameter:
x: value to be passed to cos ()Returns: Returns the cosine of value passed as argument
Code # 1:
|
Output:
The value of cosine of pi / 6 is: 0.8660254037844387
Code # 2:
|
Exit:
in_array: [-6.28318531 -5.62179738 -4.96040945 -4.29902153 - 3.6376336 -2.97624567
-2.31485774 -1.65346982 -0.99208189 -0.33069396 0.33069396 0.99208189
1.65346982 2 .31485774 2.97624567 3.6376336 4.29902153 4.96040945
5.62179738 6.28318531]out_array: [1.0, 0.7891405093963934, 0.2454854871407988, -0.40169542465296987, -0.8794737512064891, -0.9863613034027223, -0.6772815716257412, -0.08257934547233249, 0.5469481581224268, 0.9458172417006346, 0.9458172417006346, 0.5469481581224268, -0.0825793454723316, -0.6772815716257405, -0.9863613034027223, -0.8794737512064893, -0.40169542465296987, 0.2454854871407988, 0.789140509ques> ssobcode.topages =
.jpg "/>