Skip to content

kik369/quadratic-equation-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quadratic Equation Solver

Description

The quadratic-equation-solver is a robust Python script designed to solve quadratic equations, handling both real and complex roots. It incorporates comprehensive error handling and presents results clearly, including a graphical visualization of the equation. The code is structured for maintainability and testability, following best practices for professional software development.

Installation

To use this script, you'll need Python installed on your system along with the matplotlib and numpy libraries.

Prerequisites

  • Python 3.x
  • matplotlib
  • numpy

Setup

  1. Clone the repository:
    git clone https://github.com/kik369/quadratic-equation-solver.git
  2. Navigate to the cloned directory:
    cd quadratic-equation-solver
  3. (Optional) Create and activate a virtual environment:
    python3 -m venv .venv  # Create a virtual environment (Use python -m venv .venv on Windows)
    source .venv/bin/activate  # Activate the virtual environment (Use .venv\Scripts\activate on Windows)
  4. Install the required packages:
    pip install -r requirements.txt

Usage

Run the script by passing the coefficients of the quadratic equation as command-line arguments:

python quadratic.py <a> <b> <c>

Example Output

Here are some example outputs showing the graph of the quadratic equation and its solutions:

Example 1 Example 2 Example 3 Example 4

About

Solve and graph quadratic equations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages