|
| 1 | +# MathPlotter++ |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +Math Plotter++ is an application for plotting mathematical functions, built |
| 10 | +with C++20, [SFML](https://github.com/SFML/SFML) for graphics, [muParser](https://github.com/beltoforion/muparser) for parsing mathematical expressions, |
| 11 | +and [Dear ImGui](https://github.com/ocornut/imgui) for the user interface. |
| 12 | + |
| 13 | +## Features |
| 14 | + |
| 15 | +### Multiple Functions |
| 16 | + |
| 17 | +Plot up to 15 mathematical functions simultaneously. |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +### Themes |
| 22 | + |
| 23 | +Switch between three color themes. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +### Navigation |
| 28 | + |
| 29 | +Pan and zoom using the mouse while the coordinate grid dynamically adapts |
| 30 | +to the current zoom level. |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +### Function Customization |
| 35 | + |
| 36 | +Change function colors and get immediate feedback for invalid expressions. |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +## Architecture |
| 41 | + |
| 42 | +Math Plotter++ is split into separate components, each responsible for a |
| 43 | +specific part of the application. The `Application` class manages the main |
| 44 | +application lifecycle and connects these components together. |
| 45 | + |
| 46 | +- `Application`: manages the application lifecycle and coordinates components. |
| 47 | +- `CameraController`: handles graph navigation, zooming, and the viewport. |
| 48 | +- `GridRenderer`: renders the coordinate grid, axes, and labels. |
| 49 | +- `FunctionRenderer`: parses and renders mathematical functions. |
| 50 | +- `UserInterface`: manages the ImGui-based user interface. |
| 51 | +- `Theme`: manages application color themes. |
| 52 | +- `ColorPalette`: defines the colors used by the themes. |
| 53 | + |
| 54 | +## Build and Run |
| 55 | + |
| 56 | +Math Plotter++ currently targets Linux. |
| 57 | + |
| 58 | +### Requirements |
| 59 | + |
| 60 | +- C++20 compatible compiler |
| 61 | +- CMake 3.22 or newer |
| 62 | +- Git |
| 63 | + |
| 64 | +On Ubuntu and other Debian-based distributions, install the required tools |
| 65 | +and SFML system dependencies: |
| 66 | + |
| 67 | +```bash |
| 68 | +sudo apt update |
| 69 | + |
| 70 | +sudo apt install \ |
| 71 | + build-essential \ |
| 72 | + cmake \ |
| 73 | + git \ |
| 74 | + libx11-dev \ |
| 75 | + libxrandr-dev \ |
| 76 | + libxcursor-dev \ |
| 77 | + libxi-dev \ |
| 78 | + libudev-dev \ |
| 79 | + libfreetype-dev \ |
| 80 | + libgl1-mesa-dev \ |
| 81 | + libegl1-mesa-dev |
| 82 | +``` |
| 83 | + |
| 84 | +### Build |
| 85 | + |
| 86 | +Clone the repository: |
| 87 | + |
| 88 | +```bash |
| 89 | +git clone https://github.com/<username>/math-plotter.git |
| 90 | +cd math-plotter |
| 91 | +``` |
| 92 | + |
| 93 | +Configure and build the project: |
| 94 | + |
| 95 | +```bash |
| 96 | +cmake -S . -B build |
| 97 | +cmake --build build |
| 98 | +``` |
| 99 | + |
| 100 | +CMake automatically downloads and builds SFML, Dear ImGui, ImGui-SFML, |
| 101 | +and muParser. |
| 102 | + |
| 103 | +### Run |
| 104 | + |
| 105 | +```bash |
| 106 | +./build/mathplotter |
| 107 | +``` |
| 108 | + |
| 109 | +## License |
| 110 | + |
| 111 | +This project is licensed under the terms of the [MIT License](LICENSE). |
0 commit comments