This program solves quadratic equations and plots their corresponding graphs. It utilizes the numpy
, matplotlib
, and cmath
libraries.
To run the program, execute the ax.py
file. You'll be prompted whether you want to continue or not. By entering yes
, you can input the quadratic equation coefficients and it will be solved and graphically represented.
- The coefficients of the quadratic equation should be entered in the form
ax^2 + bx + c
. - If the coefficient
a
is equal to zero, an error message will be displayed. - If the discriminant
delta
is negative, complex roots and the absence of real solutions will be displayed. - If invalid inputs are entered, an error message will be displayed.
To install the required dependencies, use the following commands:
pip install numpy matplotlib cmath platform
Run
python ax.py
The program has been tested on both Windows and Linux operating systems.
Enter a = 1
Enter b = -3
Enter c = 2
delta = 1.0
x1 = 2.0
x2 = 1.0
Special thanks to the esteemed Professor Hamidreza Abbaszadeh Darban for his invaluable contributions and guidance.