Для каждого уравнения найдем уравнение вида y = kx + b:
x - 3y + 6 = 03y = x + 6y = (1/3)x + 2
x - 3y + 18 = 03y = x + 18y = (1/3)x + 6
3x + 3 = 2y - 22y = 3x + 5y = (3/2)x + (5/2)
x + 2 = 3y - 163y = x + 18y = (1/3)x + 6
Теперь построим графики этих функций на одном графике:
import matplotlib.pyplot as pltimport numpy as np
x = np.linspace(-10, 10, 400)y1 = (1/3)x + 2y2 = (1/3)x + 6y3 = (3/2)x + (5/2)y4 = (1/3)x + 6
plt.figure(figsize=(10, 6))plt.plot(x, y1, label='y = (1/3)x + 2', color='red')plt.plot(x, y2, label='y = (1/3)x + 6', color='blue')plt.plot(x, y3, label='y = (3/2)x + (5/2)', color='green')plt.plot(x, y4, label='y = (1/3)x + 6', color='purple')plt.xlim(-10, 10)plt.ylim(-10, 10)plt.axhline(0, color='black',linewidth=0.5)plt.axvline(0, color='black',linewidth=0.5)plt.grid(color = 'gray', linestyle = '--', linewidth = 0.5)plt.legend()plt.show()
Для каждого уравнения найдем уравнение вида y = kx + b:
x - 3y + 6 = 0
3y = x + 6
y = (1/3)x + 2
x - 3y + 18 = 0
3y = x + 18
y = (1/3)x + 6
3x + 3 = 2y - 2
2y = 3x + 5
y = (3/2)x + (5/2)
x + 2 = 3y - 16
3y = x + 18
y = (1/3)x + 6
Теперь построим графики этих функций на одном графике:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-10, 10, 400)
y1 = (1/3)x + 2
y2 = (1/3)x + 6
y3 = (3/2)x + (5/2)
y4 = (1/3)x + 6
plt.figure(figsize=(10, 6))
plt.plot(x, y1, label='y = (1/3)x + 2', color='red')
plt.plot(x, y2, label='y = (1/3)x + 6', color='blue')
plt.plot(x, y3, label='y = (3/2)x + (5/2)', color='green')
plt.plot(x, y4, label='y = (1/3)x + 6', color='purple')
plt.xlim(-10, 10)
plt.ylim(-10, 10)
plt.axhline(0, color='black',linewidth=0.5)
plt.axvline(0, color='black',linewidth=0.5)
plt.grid(color = 'gray', linestyle = '--', linewidth = 0.5)
plt.legend()
plt.show()