mathVis is a Streamlit-powered educational app for exploring and visually understanding fundamental geometrical objects from linear and discrete optimization, such as convex hulls, polyhedra, and cones.
The app gives graphical representations, intuitive descriptions, and mathematical explanations for each object.
- Interactive selection of geometric objects: Convex Hull, Conical Hull, Convex Cone, Polytope, Polyhedral Cone, and more.
- Visualization of each object using Matplotlib.
- Clear descriptions and mathematical (LaTeX-formatted) explanations.
- Powered by Streamlit for instant web-based interactivity.
- Modular code: Easily add new objects as Python modules in the
graphs/folder.
| Structure | Convex? | Bounded? | Generators | Description |
|---|---|---|---|---|
| Convex Hull | Yes | Yes (if finite set) | Points | Smallest convex set containing a given set of points. |
| Conical Hull | Yes | No | Vectors (finite set) | All non-negative combinations of given vectors. |
| Convex Cone | Yes | No (except |
Directions/rays (possibly infinite) | Any set closed under non-negative scaling/addition. |
| Polyhedral Cone | Yes | No (except |
Vectors (finite set) | Convex cone defined by finitely many linear inequalities. |
| Polyhedron | Yes | Not always | Faces/vertices/edges | Solution set to finitely many linear inequalities. |
| Polytope | Yes | Yes | Vertices (finite set) | Bounded polyhedron; convex hull of a finite set of points. |
- Python 3.8+
- pip
Clone this repository:
git clone https://github.com/IhebDridi/mathVis.git
cd mathVisInstall dependencies:
pip install -r requirements.txtstreamlit run MainStreamLit.pyYour web browser will open automatically. Use the sidebar to select a geometric object and view its visualization, description, and mathematical explanation.
mathVis/
│
├── MainStreamLit.py # Main Streamlit app
├── graphs/ # Individual Python modules for each graph type
│ ├── ConvexHull2D.py
│ ├── Polytope.py
│ └── ...
├── requirements.txt
├── README.md
- Create a new Python file in
graphs/, e.g.,MyPolyhedron.py. - Define a function
plot_mypolyhedronthat returns(fig, description, math_explanation). - The app will automatically load new graph types at startup!
- Push your repo to GitHub.
- Go to https://streamlit.io/cloud.
- Link your repo and deploy.
- Updates auto-deploy when you push new changes.
See the official docs for more details.
- Built with Streamlit
- Mathematical algorithms from scipy and numpy
- Visualization by matplotlib
MIT License
Open an issue or pull request to suggest new geometries, fix bugs, or add documentation!
🚀 Try the app online:
https://mathvis-8fot3lo7zuzehveqhsrdld.streamlit.app/
Enjoy visualizing mathematics!
