Skip to content

Quadratic equations solver. Python3 package to SOLVE, FACTORISE, and GRAPH quadratic equations. CLI Tool and Demo included

License

Notifications You must be signed in to change notification settings

max9836/QuadratticEquationSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EquationSolver

Small CLI tool to solve, factorise and plot quadratic equations.

Demo (no installation required)

This repository includes demo.py — a self-contained, minimal demo of the CLI so you can try features without installing the package.

Purpose

  • Quick, standalone interactive demo for parsing, solving, factorising and graphing quadratic equations.
  • Run directly from the repository root; no pip install required.

Prerequisites

  • Python 3.8+
  • Dependencies:
    • numpy
    • matplotlib

Install dependencies (recommended in a virtual environment):

python3 -m pip install requirements.txt

Run the demo

From the project root:

python3 demo.py

Behavior / Features

  • Interactive menu offering:
    • Solve — parse equations and compute roots
    • Graph — plot equations with annotated real roots (matplotlib)
    • Solve + Graph — compute then plot
    • Factorise — print factorised forms when possible
    • Exit — quit the demo
  • Input methods:
    • File input: path to a text file with one equation per line (format: ax^2 + bx + c, omit = 0). Lines starting with # are ignored.
    • Manual input: enter equations line-by-line; finish with a blank line.
  • Parsing supports shorthand coefficients: "" or "+" → 1, "-" → -1.
  • Outputs numeric roots and rational approximations (fractions) where applicable.

Example equation file (sample.txt)

2x^2 + 5x - 3
-x^2 + 4x + 7
x^2 - 2x + 1

Notes & Tips

  • Run demo.py directly for quick testing and development — no packaging or installation needed.
  • For working with the packaged CLI (equationsolver / equasolve), prefer refactoring package modules to use relative imports and then install in editable mode:
python -m pip install -e .
  • If matplotlib windows do not appear on Linux, ensure your DISPLAY/X configuration is correct or run in an environment that supports graphics.

Project

  • Entry points when installed (via setup.py): equationsolver, equasolve
  • See /docs for installation, API and contribution details.

License

  • GPLv3 (see LICENSE.md)

About

Quadratic equations solver. Python3 package to SOLVE, FACTORISE, and GRAPH quadratic equations. CLI Tool and Demo included

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages