A python package designed to facilitate the solving and manipulation of quadratic equations.
Project description
Pyquadratic
Description
A python package designed to facilitate the solving and manipulation of quadratic equations.
simplifyQuadratic()
Returns a simplified quadratic functions from the given input quadratic function.
Parameters
Parameter | Type | Values |
---|---|---|
stdForm | str |
"2x^2+8x+2" |
Return type
str
Errors
- If the
stdForm
value provided is not in the correct format a,Value Error
exception is raised.
realSolution()
Returns the solutions for a quadratic equation entered in the format ax^2+bx+c
Parameters
Parameter | Type | Values |
---|---|---|
stdForm | str |
"ax^2+bx+c" |
Return type
float[2]
or int[2]
Errors
- If the
stdForm
value provided is not in the correct format, aValue Error
exception is raised. - If a real solution does not exist, a
Value Error
exception is raised.
toFactoredForm()
Returns the factored form of the corresponding standard form of quadratic equation
Parameters
Parameter | Type | Values |
---|---|---|
stdForm | str |
"ax^2+bx+c" |
Return type
str
Errors
- If the
stdForm
value provided is not in the correct format, aValue Error
exception is raised. - If a real solution does not exist, a
Value Error
exception is raised.
toVertexForm()
Returns the vertex form of the corresponding standard form of quadratic equation
Parameters
Parameter | Type | Values |
---|---|---|
stdForm | str |
"ax^2+bx+c" |
Return type
str
Errors
- If the
stdForm
value provided is not in the correct format, aValue Error
exception is raised.
pyquadratic._readString()
(Private: for contributors only)
Returns the coefficients for an ax^2+bx+c string of a quadratic equation
Parameters
Parameter | Type | Values |
---|---|---|
stdForm | str | "ax^2+bx+c" |
Return type
float[3]
or int[3]
Errors
- If the
stdForm
value provided is not in the correct format, aValue Error
exception is raised.
Instructions
Use the standard form ax^2+bx+c
to use pyquadratic functions (Always assume = 0)
How to import:
Go to terminal and run:
pip install pyquadratic
In your python file, be sure to include:
from pyquadratic.pyquadratic import *
Now you will be able to use the functions included in the pyquadratic package!
How to Contribute to the Project:
How to Set Up the Virtual Environment
-
Fork the Repository.
-
Clone it to your local directory.
-
Go to terminal, locate the project directory, and run:
pip install pipenv
. -
Run
pipenv shell
to activate the virtual environment. -
Run
pipenv install
to install all the required dependencies for developemnt.
How to Build
-
Before every build, make sure you delete
dist
andpyquadratic.egg-info
directory. -
Update version number in
pyproject.toml
if approved. -
Go to terminal, locate the project directory, and run:
python -m build
orpython3 -m build
.
How to Test
- Go to terminal, locate the project directory, and run:
pytest
.
Team Members
Nicolas Izurieta: https://github.com/ni2050
Patrick Zhao: https://github.com/PatrickZhao0
Brad Yin: https://github.com/BREADLuVER
Yucheng Xu: https://github.com/Yucheng-XPH
Link to Package
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pyquadratic-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c3b4412da8cc6e12da8b7f1c56f26ff8e63d5b9f0dec102c10e3bef22c8168f |
|
MD5 | 44af8a13af63a1d91b9f66c2e0643450 |
|
BLAKE2b-256 | 6ab10f4237ea1eb2339b86185c32f805050d4f7bce37618d8c9007203cd3c05d |