https://github.com/amir13872/hi-quadratic-
This Python script defines a simple quadratic equation calculator that calculates the roots of a quadratic equation based on user input. It also provides a visual representation of the quadratic function using a graph.
https://github.com/amir13872/hi-quadratic-
complex-numbers mathematical-functions mathematics mathematics-education matplotlib numpy python-calculator quadratic-equation-solver
Last synced: 4 months ago
JSON representation
This Python script defines a simple quadratic equation calculator that calculates the roots of a quadratic equation based on user input. It also provides a visual representation of the quadratic function using a graph.
- Host: GitHub
- URL: https://github.com/amir13872/hi-quadratic-
- Owner: amir13872
- Created: 2024-06-10T09:49:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-10T10:14:20.000Z (about 1 year ago)
- Last Synced: 2025-01-17T08:38:24.300Z (5 months ago)
- Topics: complex-numbers, mathematical-functions, mathematics, mathematics-education, matplotlib, numpy, python-calculator, quadratic-equation-solver
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hi-Quadratic-
# Quadratic Equation Solver and Graph Plotter
This program solves quadratic equations and plots their corresponding graphs. It utilizes the `numpy`, `matplotlib`, and `cmath` libraries.
## Usage
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.
## Important Notes
- 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.## Installation
To install the required dependencies, use the following commands:
```sh
pip install numpy matplotlib cmath platform
```
Run
```sh
python ax.py
```## Supported Operating Systems
The program has been tested on both Windows and Linux operating systems.
## Example
```python
Enter a = 1
Enter b = -3
Enter c = 2
delta = 1.0
x1 = 2.0
x2 = 1.0
```## Thanks
Special thanks to the esteemed Professor **Hamidreza Abbaszadeh Darban** for his invaluable contributions and guidance.