Inspiration

Throughout middle and high school, I have enjoyed learning math. I have been inspired by graphing calculators like Desmos, which compound my understanding by visualizing the complex and confusing formulas that are used in higher level math courses. It is in that spirit that I decided to create a graphing calculator, to better understand the technology that was instrumental in furthering my knowledge.

What it does

In this program, the user can enter an equation, which is then displayed graphically on a Cartesian graph. The user can use the standard operations of PEMDAS, such as addition, subtraction, multiplication, division, exponentiation, and include parenthesis. The user can then pan across the graph, manually input the window’s bounds, and return back to a standard window position. Additionally, the user can click on various points on the equation’s graph, and view the exact point, with decimal precision.

How we built it

The most challenging part of the calculator is actually evaluating the equations that are inputted, and turning the equation’s string into instructions. I ended up using multiple stacks to parse the numbers and operators separately, allowing for the ordering of PEMDAS to be preserved. I then used my experience in java swing programming to create the GUI for the program, adding finishing touches like the ability to pan using the mouse.

Challenges we ran into

Once all the initial compiling issues were out of the way, a challenge that I ran into was preserving the order of operations. At first, the equation y = x - 1 + x would simplify to y = 1, since the program reads from right to left, rather than the proper left to right approach, as stacks are last in first out. I eventually fixed this by reading the equation in backwards, so that the left to right approach was kept.

What's next for MVGrapher

Next, I think that inclusions of parametric functions, as well as just allowing for multiple functions at once would be at the top of my list, as well as a zoom feature. Including more functions such as the trigonometric functions or logarithmic functions would be useful, as well as including shortcuts for common variables like e or pi.

Built With

Share this project:

Updates