GithubHelp home page GithubHelp logo

lawsus / math-interpreter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 131 KB

Math Interpreter: A simple web application capable of parsing and evaluating mathematical expressions with support for basic arithmetic operations and trigonometric functions.

Home Page: https://lawsus.pythonanywhere.com/

Python 70.52% HTML 29.48%
flask interpreter mathematics python webapp

math-interpreter's Introduction

Math Interpreter

Math Interpreter is a web application that accurately evaluates mathematical expressions, visualizing the underlying abstract syntax tree for better understanding of the expression's structure.

drawing

Sample output of the Math Interpreter for sin(-3 * pi / 2).

Features:

  • Tokenization: Converts the input mathematical expression into tokens.
  • Parsing: Transforms the list of tokens into an abstract syntax tree (AST).
  • Evaluation: Computes the result of the expression based on its AST.
  • Visualization: Renders the AST as a graphical tree using Graphviz.
  • Supported Operations: Basic arithmetic (+, -, *, /, ^), trigonometric functions (sin, cos, tan), and constants (pi).

Setup & Installation:

  1. Clone the repository:

    git clone https://github.com/lawsus/math-interpreter.git
  2. Navigate to the project directory:

    cd math-interpreter
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Start the Flask application:

    python main.py

The application should now be running on a local server.

Usage:

  1. Navigate to the local server.
  2. Enter a valid mathematical expression in the input field.
  3. Click "Evaluate".
  4. View the resulting value of the expression, the inorder traversal, and the visualized AST.

Contribution:

Contributions are welcome.

math-interpreter's People

Contributors

lawsus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.