Math Problem Statement
Постройте графики функций!
а) y = 2cosx
б) y = sin 2x
в) y = 2sinx + 3
Solution
numpy as np import matplotlib.pyplot as plt
Define the x values for plotting
x = np.linspace(-2 * np.pi, 2 * np.pi, 400)
Define the functions
y1 = 2 * np.cos(x) y2 = np.sin(2 * x) y3 = 2 * np.sin(x) + 3
Create the plots
plt.figure(figsize=(12, 8))
Plot for y = 2cos(x)
plt.subplot(3, 1, 1) plt.plot(x, y1, label=r'$y = 2 \cos(x)$') plt.title(r'$y = 2 \cos(x)$') plt.grid(True) plt.axhline(0, color='black',linewidth=1) plt.axvline(0, color='black',linewidth=1) plt.legend(loc='upper right')
Plot for y = sin(2x)
plt.subplot(3, 1, 2) plt.plot(x, y2, label=r'$y = \sin(2x)$') plt.title(r'$y = \sin(2x)$') plt.grid(True) plt.axhline(0, color='black',linewidth=1) plt.axvline(0, color='black',linewidth=1) plt.legend(loc='upper right')
Plot for y = 2sin(x) + 3
plt.subplot(3, 1, 3) plt.plot(x, y3, label=r'$y = 2 \sin(x) + 3$') plt.title(r'$y = 2 \sin(x) + 3$') plt.grid(True) plt.axhline(0, color='black',linewidth=1) plt.axvline(0, color='black',linewidth=1) plt.legend(loc='upper right')
Adjust layout and show the plot
plt.tight_layout() plt.show()Вот графики для заданных функций:
- — график косин
Ask a new question for Free
By Image
Drop file here or Click Here to upload
Math Problem Analysis
Mathematical Concepts
Trigonometry
Graphing Trigonometric Functions
Formulas
y = 2cos(x)
y = sin(2x)
y = 2sin(x) + 3
Theorems
Basic Trigonometric Identities
Graphing of Trigonometric Functions
Suitable Grade Level
Grades 9-12
Related Recommendation
Graphing Trigonometric Functions: y = 2cos(x), y = sin(2x), y = 2sin(x) + 3
Graphing y = sin(3x) + cos(2x) - Trigonometric Functions
Graphing y = x and y = 2sinx: A Step-by-Step Guide
Graphing y=2sin(-3x-π/2)+2: Step-by-Step Guide with Key Points
Graph of y = 2 cos(x + 30°) - Amplitude and Phase Shift Explained