Mathematische Funktionen in Python | Satz 3 (Trigonometrische und Winkelfunktionen)

Einige der mathematischen Funktionen werden im folgenden Satz 1 und Satz 2 erläutert Mathematische Funktionen in Python | Satz 1 (Numerische Funktionen) Mathematische Funktionen in Python | Satz 2 (Logarithmische und Potenzfunktionen) In diesem Artikel werden trigonometrische und Winkelfunktionen besprochen. 1. sin() :- Diese Funktion gibt die zurück ihre als Argument übergebener Wert. Der in dieser Funktion übergebene Wert sollte in sein Bogenmaß . 2. cos() :- Diese Funktion gibt die zurück Kosinus als Argument übergebener Wert. Der in dieser Funktion übergebene Wert sollte in sein Bogenmaß . Python
   # Python code to demonstrate the working of   # sin() and cos()   # 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  ))   # returning the value of cosine of pi/6   print   (  'The value of cosine of pi/6 is : '     end  =  ''  )   print   (  math  .  cos  (  a  ))   
Output:
The value of sine of pi/6 is : 0.49999999999999994 The value of cosine of pi/6 is : 0.8660254037844387  

3. tan() :- Diese Funktion gibt die zurück Tangente als Argument übergebener Wert. Der in dieser Funktion übergebene Wert sollte in sein Bogenmaß . 4. hypot(a b) :- Dies gibt die zurück Hypotenuse der in Argumenten übergebenen Werte. Numerisch gibt es den Wert von zurück sqrt(a*a + b*b) . Python
   # Python code to demonstrate the working of   # tan() and hypot()   # importing 'math' for mathematical operations   import   math   a   =   math  .  pi  /  6   b   =   3   c   =   4   # returning the value of tangent of pi/6   print   (  'The value of tangent of pi/6 is : '     end  =  ''  )   print   (  math  .  tan  (  a  ))   # returning the value of hypotenuse of 3 and 4   print   (  'The value of hypotenuse of 3 and 4 is : '     end  =  ''  )   print   (  math  .  hypot  (  b    c  ))   
Output:
The value of tangent of pi/6 is : 0.5773502691896257 The value of hypotenuse of 3 and 4 is : 5.0  

5. Grad() :- Diese Funktion dient dazu Konvertieren Sie den Argumentwert vom Bogenmaß in Grad . 6. Bogenmaß() :- Diese Funktion dient dazu Konvertieren Sie den Argumentwert von Grad in Bogenmaß . Python
   # Python code to demonstrate the working of   # degrees() and radians()   # importing 'math' for mathematical operations   import   math   a   =   math  .  pi  /  6   b   =   30   # returning the converted value from radians to degrees   print   (  'The converted value from radians to degrees is : '     end  =  ''  )   print   (  math  .  degrees  (  a  ))   # returning the converted value from degrees to radians   print   (  'The converted value from degrees to radians is : '     end  =  ''  )   print   (  math  .  radians  (  b  ))   
Output:
The converted value from radians to degrees is : 29.999999999999996 The converted value from degrees to radians is : 0.5235987755982988  

Das Könnte Ihnen Gefallen