Advertisement
mirosh111000

3

Sep 17th, 2023
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. def f(x):
  5.     return (np.sin(x)**2 + np.cos(2 * x)) / (np.sin(x**2) + 2)
  6.  
  7. def grafic(x, y):
  8.     plt.title("f(x)")
  9.     plt.xlabel("x")
  10.     plt.ylabel("y")
  11.     plt.grid()
  12.     plt.plot(x, y, label='f(x)=(sin(x)^2 + cos(2x)) / (sin(x^2) + 2)')
  13.     plt.show()
  14.  
  15. X = np.linspace(-np.pi, np.pi, 1000)
  16. Y = f(X)
  17. grafic(X, Y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement