Skip to content

Latest commit

 

History

History
20 lines (17 loc) · 360 Bytes

683-1992278-一元二次方程.sy.md

File metadata and controls

20 lines (17 loc) · 360 Bytes
import numpy as np
import matplotlib.pyplot as plt
 
# 定义一元二次方程函数
def quadratic_equation(x):
    return x**2 + 3*x - 5
 
# 生成x轴上的点
x = np.linspace(-10, 10, 100)
y = [quadratic_equation(i) for i in x]
 
# 绘制曲线图
plt.plot(x, y)
plt.title('Quadratic Equation')
plt.xlabel('X')
plt.ylabel('Y')
plt.grid()
plt.show()