PyMathPlot is a Python application for plotting mathematical functions and finding their intersections. It provides a graphical user interface (GUI) built with PySide2 and uses SymPy for symbolic mathematics and Matplotlib for plotting.
- Plot mathematical functions f(x) and g(x)
- Find and display intersection points of f(x) and g(x)
- Fit the plot view to the intersection points
- Save the plot as an image file
-
Clone the repository:
git clone https://github.com/ahmadel1/pymathplot.git cd pymathplot -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the application:
python main.py
-
Use the GUI to input functions, set the plot range, and perform actions such as plotting functions, finding intersections, and saving the plot.
main.py: Entry point of the application.src/: Contains the source code.model.py: Defines theFunctionModelclass for mathematical operations.view.py: Defines theMainWindowclass for the GUI.controller.py: Defines theMainControllerclass for handling interactions between the model and the view.
tests/: Contains unit tests for the application.requirements.txt: Lists the dependencies required for the project.README.md: Project documentation.
To run the tests, use the following command:
pytest