Advertisement
mirosh111000

10

Sep 17th, 2023
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import numpy as np
  3.  
  4.  
  5. def f1(x):
  6.     return np.exp(np.sin(x)) + 1
  7.  
  8. def f2(x):
  9.     return np.cos(x)**2 - 5
  10.  
  11. def f3(x):
  12.     return 1 / (np.cos(x**2) + 5)
  13.  
  14. x = np.linspace(0, 100, 1000)
  15. y1 = f1(x)
  16. y2 = f2(x)
  17. y3 = f3(x)
  18. plt.xlabel("x")
  19. plt.ylabel("y")
  20. plt.plot(x, y1, label='f(x) = e^sin(x)')
  21. plt.plot(x, y2, label='f(x) = cos(x)^2 - 5')
  22. plt.plot(x, y3, label='f(x) = 1 / (cos(x^2) + 5)')
  23. plt.grid()
  24. plt.legend()
  25. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement