Equation Visualizer is a Streamlit-based web application that allows users to input mathematical expressions, convert them into valid SymPy expressions using Gemini AI, and plot their graphs.
- Accepts mathematical expressions with
xas the only variable. - Uses Google Gemini AI to correct and convert input expressions into SymPy-compatible format.
- Plots the function using Matplotlib.
- Handles errors such as undefined variables, division by zero, and invalid syntax.
Ensure you have the following installed:
- Python 3.8+
- Required Python libraries:
pip install streamlit sympy numpy matplotlib google-generativeai python-dotenv
- A valid Google API key stored in a
.envfile:echo "API_KEY=your_google_api_key_here" > .env
-
Clone the repository:
git clone https://github.com/A-Vamshi/EquationVisualizer.git cd EquationVisualizer -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
streamlit run app.py
-
Enter a mathematical expression in the input box and click "Graph the equation."
| Input Expression | Converted SymPy Expression |
|---|---|
x^2 + 3*x + 2 |
x**2 + 3*x + 2 |
sin(x) + cos(x) |
-1 (invalid input) |
5x^2 + 2x + 3 |
5*x**2 + 2*x + 3 |
├── app.py # Main application script
├── requirements.txt # Dependencies
├── .env # API key storage
├── README.md # Documentation
Feel free to contribute by submitting issues or pull requests.
MIT License



