Skip to content

Interactive Python tool for mathematical function visualization, analysis, and symbolic computation with matplotlib and SymPy.

Notifications You must be signed in to change notification settings

AdiFranDev/Function-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“Š Calc-U-Later: Advanced Function Visualizer

A comprehensive Python application for mathematical function visualization, analysis, and computation. Built with Tkinter for the GUI, matplotlib for plotting, and SymPy for symbolic mathematics.

๐ŸŒŸ Features

๐Ÿ“ˆ Function Visualization

  • Interactive Plotting: Plot mathematical functions with customizable ranges
  • Multiple Function Display: Simultaneously view original function, derivatives, and integrals
  • Higher-Order Derivatives: Calculate and visualize derivatives of any order
  • Professional Styling: Clean, modern interface with enhanced visual design

๐Ÿงฎ Mathematical Analysis

  • Symbolic Computation: Calculate symbolic derivatives and integrals using SymPy
  • Numerical Integration: Compute definite integrals using SciPy's quad function
  • Comprehensive Analysis: Get detailed mathematical insights about your functions
  • Real-time Computation: Instant calculations and visualizations

๐ŸŽฏ User Interface

  • Tabbed Interface: Organized workflow with Function Input, Visualization, and Results tabs
  • Quick Function Buttons: One-click insertion of common mathematical functions
  • Interactive Navigation: Zoom, pan, and explore plots with matplotlib toolbar
  • Help System: Built-in documentation and syntax guide

๐Ÿ’พ Export & Save

  • Multiple Formats: Save graphs as PNG, PDF, or SVG files
  • High Quality: 300 DPI output for publication-ready graphics
  • Professional Layout: Clean, publication-ready plot styling

๐Ÿš€ Getting Started

Prerequisites

pip install tkinter matplotlib numpy scipy sympy

Installation

  1. Clone or download the project files
  2. Ensure all dependencies are installed
  3. Run the main application:
python main.py

Quick Start

  1. Launch the Application: Run main.py to open the welcome screen
  2. Start Visualizing: Click "๐Ÿš€ Start Visualizing" to open the function visualizer
  3. Enter a Function: Type your mathematical function in the input field
  4. Set Range: Adjust x_min and x_max values for your desired plot range
  5. Visualize: Click "๐Ÿ” Visualize" to generate the plot
  6. Analyze: Use "๐Ÿงฎ Compute" for detailed mathematical analysis

๐Ÿ“š Function Syntax

Supported Operations

Operation Syntax Example
Addition + x + 5
Subtraction - x - 3
Multiplication * 3*x
Division / x/2
Exponentiation ** x**2

Mathematical Functions

Function Syntax Description
Sine sin(x) Trigonometric sine
Cosine cos(x) Trigonometric cosine
Tangent tan(x) Trigonometric tangent
Exponential exp(x) e^x
Natural Log log(x) ln(x)
Square Root sqrt(x) โˆšx
Absolute Value abs(x) |x|

Constants

  • pi - ฯ€ (3.14159...)
  • e - Euler's number (2.71828...)

Example Functions

x**2 + 3*x + 5          # Quadratic function
sin(x) + cos(x)         # Trigonometric combination
exp(-x**2)              # Gaussian function
log(x**2 + 1)          # Logarithmic function
sqrt(abs(x))           # Composite function

๐Ÿ—๏ธ Project Structure

Function Visualizer/
โ”œโ”€โ”€ main.py                 # Main application entry point
โ”œโ”€โ”€ function_vis.py         # Core visualization application class
โ”œโ”€โ”€ compute_engine.py       # Mathematical computation engine
โ”œโ”€โ”€ utils.py               # Utility functions (window centering)
โ”œโ”€โ”€ ui/
โ”‚   โ”œโ”€โ”€ components.py      # UI component creation functions
โ”‚   โ”œโ”€โ”€ styles.py          # Application styling and themes
โ”‚   โ””โ”€โ”€ __pycache__/       # Python bytecode cache
โ””โ”€โ”€ __pycache__/           # Python bytecode cache

Core Components

main.py

  • Application entry point
  • Welcome screen with launcher interface
  • Navigation to function visualizer

function_vis.py

  • Main visualization application class
  • Tabbed interface management
  • Plot generation and interaction handling
  • Event handling for all user actions

compute_engine.py

  • Mathematical computation backend
  • Function parsing and validation
  • Symbolic and numerical calculations
  • Derivative and integral computation

utils.py

  • Utility functions for UI management
  • Window positioning and centering

ui/components.py

  • UI component creation and layout
  • Input sections, visualization areas, results display
  • Button configurations and event bindings

ui/styles.py

  • Application theming and visual styling
  • Color schemes and typography
  • Button and widget styling configurations

๐Ÿ”ง Technical Details

Dependencies

  • Tkinter: GUI framework (built into Python)
  • Matplotlib: 2D plotting library for visualizations
  • NumPy: Numerical computing for array operations
  • SciPy: Scientific computing for numerical integration
  • SymPy: Symbolic mathematics for analytical computations

Key Algorithms

  • Function Parsing: SymPy-based expression parsing with error handling
  • Numerical Differentiation: Gradient-based derivative approximation
  • Symbolic Differentiation: SymPy's diff function for exact derivatives
  • Numerical Integration: SciPy's quad function for definite integrals
  • Plotting: High-resolution matplotlib figures with custom styling

Performance Considerations

  • Efficient Plotting: 1000-point resolution for smooth curves
  • Error Handling: Comprehensive exception handling for mathematical edge cases
  • Memory Management: Proper cleanup of matplotlib figures
  • Responsive UI: Non-blocking operations with progress feedback

๐ŸŽจ User Interface Design

Design Philosophy

  • Clean and Modern: Minimalist interface focusing on functionality
  • Professional Appearance: Suitable for academic and professional use
  • Intuitive Navigation: Logical workflow from input to analysis
  • Accessibility: Clear labels, readable fonts, and logical tab order

Color Scheme

  • Primary Blue: #3498db (buttons, accents)
  • Success Green: #27ae60 (positive actions)
  • Warning Orange: #e67e22 (caution actions)
  • Danger Red: #e74c3c (destructive actions)
  • Background: #f8f9fa (light, easy on eyes)

๐Ÿ“Š Mathematical Capabilities

Supported Function Types

  • Polynomial Functions: Linear, quadratic, cubic, and higher-order
  • Trigonometric Functions: sin, cos, tan and their inverses
  • Exponential Functions: Natural and arbitrary base exponentials
  • Logarithmic Functions: Natural and common logarithms
  • Composite Functions: Complex combinations of basic functions

Analysis Features

  • Symbolic Derivatives: Exact analytical derivatives using SymPy
  • Higher-Order Derivatives: Derivatives of any positive integer order
  • Definite Integration: Numerical integration over specified intervals
  • Function Evaluation: Point-by-point function evaluation
  • Error Analysis: Comprehensive error handling for mathematical edge cases

๐Ÿ› ๏ธ Customization

Adding New Functions

To add support for new mathematical functions:

  1. Update the function parser in compute_engine.py
  2. Add quick function buttons in ui/components.py
  3. Update help documentation as needed

Styling Modifications

Customize the application appearance by modifying:

  • Color schemes in ui/styles.py
  • Layout parameters in ui/components.py
  • Plot styling in function_vis.py

๐Ÿค Contributing

This is an educational project showcasing mathematical visualization capabilities.

Areas for Enhancement

  • 3D Function Plotting: Support for functions of two variables
  • Animation: Animated parameter sweeping
  • More Function Types: Hyperbolic, special functions
  • Export Options: LaTeX output, data export
  • Performance: GPU acceleration for complex functions

๐Ÿ“ License

This project is created for educational purposes. Feel free to use and modify for learning and academic applications.

๐Ÿ™ Acknowledgments

  • SymPy Team: For excellent symbolic mathematics capabilities
  • Matplotlib Team: For powerful and flexible plotting tools
  • SciPy Team: For robust numerical computation functions
  • Python Community: For creating an amazing ecosystem for scientific computing

๐Ÿ“ž Support

For questions about function syntax, mathematical concepts, or application usage, refer to the built-in help system accessible through the "โ“ Help" button in the application.


Calc-U-Later - Making mathematical visualization accessible, powerful, and beautiful. ๐Ÿ“Šโœจ

About

Interactive Python tool for mathematical function visualization, analysis, and symbolic computation with matplotlib and SymPy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages