Quadratic Solver
A powerful and easy-to-use Command Line Interface (CLI) application for solving and visualizing quadratic equations. This tool computes key properties of quadratic functions and provides a graphical representation of the curve.
Note: It is recommended to use the stable release.
Features
-
Solve quadratic equations of the form: ax² + bx + c = 0
-
Compute:
- Real or complex roots
- Discriminant
- Vertex (turning point)
- Axis of symmetry
- Ordered pairs (for plotting)
- Nature of roots (distinct, repeated, or complex)
-
Graph the quadratic function directly from the CLI
Installation
Install via pip:
pip install quadratic-solver
Usage
Start by importing the model in Python:
from quadratic_solver.model import QuadraticFunctions
Make an instance of QuadraticFunctions:
qf = QuadraticFunctions(8, 23, 1)
Then call the methods:
qf.quadratic_formula() # solve and display the roots, discriminant, vertex and axis of symmetry
qf.plot_and_display_graph() # plot and display graph of the quadratic function
Methods
- convert_to_float - convert user input (a, b, c) to float and returns it.
- vertex - return tuple of ordered pair (vertex) of the function.
- discriminant - returns the discriminant of the function.
- quadratic_formula - solve and display the roots, discriminant, vertex and axis of symmetry
- plot_and_display_graph - plot and display graph of the quadratic function
Example Output
Quadratic Equation: x² - 3x + 2 = 0
Discriminant: 1
Roots: x₁ = 2, x₂ = 1
Nature of Roots: Real and Distinct
Vertex: (1.5, -0.25)
Axis of Symmetry: x = 1.5
Sample Points:
(0, 2)
(1, 0)
(2, 0)
(3, 2)
A graph window will also appear displaying the parabola.
Graphing
The application automatically generates a plot of the quadratic function, highlighting:
- The roots
- The vertex
- The curve shape (concave up or down)
How It Works
The app uses standard quadratic formula logic:
x = (-b ± √(b² - 4ac)) / (2a)
-
If the discriminant is:
- > 0 → Two real roots
- = 0 → One repeated root
- < 0 → Two complex roots
Graphing is handled programmatically using Python plotting libraries.
Requirements
-
Python 3.10+
-
Required dependencies (installed automatically):
- matplotlib
- numpy
Contributing
Contributions are welcome!
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request
License
This project is licensed under the MIT License.
Future Improvements
- Batch processing of multiple equations
- Interactive mode with command flags
Author
Built by Uchenna Adubasim
Support
If you find this project useful, consider giving it a star on GitHub!
Metadata
Release files for quadratic-solver 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quadratic_solver-1.0.6.tar.gz | 5.6 kB | Without provenance | Details for quadratic_solver-1.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quadratic_solver-1.0.6-py3-none-any.whl | Python 3 | none | any | Details for quadratic_solver-1.0.6-py3-none-any.whl |
Total release size: 12.8 kB
Release files / quadratic_solver-1.0.6.tar.gz
| Download URL | quadratic_solver-1.0.6.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0c19ad5acf7b5ab7d8849105b4ff59e6cbd8aadd20d2a637afde3850c0427a9
|
|
BLAKE2b-256 checksum How to use checksums |
de8b0a2dd89fbcdf625a101c09fad94d492e2b409c7184d4d5e361e055d688b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / quadratic_solver-1.0.6-py3-none-any.whl
| Download URL | quadratic_solver-1.0.6-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e402a1140f80af984d5c77a8ee0083775677d61c747f583bffc6c39b439501d
|
|
BLAKE2b-256 checksum How to use checksums |
b5cf0676d14802f40f520b1ca01002e35b3e29c0a93ab9caf14940bc04bcda62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for quadratic-solver 1.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.