I built a function plotter in Java featuring a custom parser for infix and reverse polish notation (RPN), AST-based evaluation, and symbolic differentiation. Includes support for common mathematical functions, parameters, and graph visualization. It is built using LiveViewProgramming for interactive browser-based output.
📌 Credits to D. Herzberg's LiveViewProgramming for providing the
Java-based live coding environment.
Steps:
- Install at least JDK-24.
- Extract the ZIP archive into a folder of your choice.
- Open this folder in an IDE of your choice (e.g., Visual Studio Code) and navigate to the
srcdirectory. - Open a new terminal (inside your IDE) and run the following command:
java -jar lvp-0.5.4.jar --log --watch=funktionsplotter.java - LVP will start with
funktionsplotter.javaand can be accessed at:http://localhost:50001/
Modifications to LVP:
Only the Turtle.java from LiveViewProgramming was reused and extended with a few additional methods to simplify and improve usability. The original Turtle implementation from the JAR file (lvp-0.5.4.jar) is not used in this project.
Extensions:
- Input and visualization of multiple functions with distinct colors
- Support for functions with a parameter
a, allowing multiple parameter values to be displayed simultaneously - Derivation of functions
Important Note: The archive contains important files:
1. funktionsplotter.java --> The Java program for the function plotter
2. lvp-0.5.4.jar --> The JAR file for LVP
3. Turtle.java --> Self-developed extended Turtle with 3 additional methods, used instead of the Turtle from the JAR file (lvp-0.5.4.jar)
4. README.md --> Information about how to run the program
When executing, make sure all files are present and you are in the correct directory!
- Install Docker on your computer.
- Open a terminal and navigate to the folder where the Dockerfile is located.
- Run the following command to build the Docker image:
docker build -t funktionsplotter.java . - Once the image is built, you can start the container with the following command:
docker run -d -p 50001:50001 funktionsplotter.java - LVP will start with
funktionsplotter.javaand can be accessed at:http://localhost:50001/