The quadratic-equation-solver
is a Python script for solving quadratic equations. It can handle equations with real and complex roots, and it visualizes the equation on a graph.
To use this script, you'll need Python installed on your system along with a few additional libraries.
- Python 3.x
- matplotlib
- numpy
-
Clone the repository:
git clone https://github.com/kik369/quadratic-equation-solver.git
-
Navigate to the cloned directory:
cd quadratic-equation-solver
-
(Optional) Create and activate a virtual environment using
virtualenv
:# First, install virtualenv if you haven't already pip install virtualenv # Create a virtual environment virtualenv env # Activate the virtual environment env\Scripts\activate # On Windows source env/bin/activate # On Unix or MacOS
-
Install the required packages:
pip install -r requirements.txt
Run the script by passing the coefficients of the quadratic equation as arguments:
python quadratic.py <a> <b> <c>
For example:
python quadratic.py 1 -5 6
This will solve the equation x² - 5x + 6 = 0
.
Distributed under the MIT License. See LICENSE
for more information.