Giter Site home page Giter Site logo

mitrella's Introduction

Mitrella

This is a graphing calculator, inspired by desmos (great tool, check it out) but using my own stack-based mathematical notation.

Screenshot showing sin, asin, and 1/sin

Notation

Read from left to right, each element is seperated by a space, an number or variable on it's own will add it to the stack. Operators pop items from the stack and then push their results to the top of the stack.

In this example, 2 is added to the stack, then 3 is added to the stack. The addition operator(+) pops the top 2 items of the stack, sums them, and then pushes the result.

2 3 +
-----
5

Note that subtraction (and division) subtracts the item on the top of the stack from the second-to-top item in the stack.

2 3 -
-----
-1

Note that there is no limit to the number of items on the stack and don't have to be operated on instantly, so

2 3 + 4 +
-----
9

is equivilent to

2 3 4 + +
-----
9

just like (2 + 3) + 4 = 2 + (3 + 4), speaking of which…

There is no order of operations, by reading from left to right and using the stack you can unambiguously determine what a expression evaluates to.

4 5 * 10 / 6 3 - +
-----
5

Optionally, you can add brackets to improve readability but these do not change the result in any way.

(4 5 * 10 /) (6 3 -) +
-----
5

mitrella's People

Contributors

voklen avatar

Watchers

 avatar Ben 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.