JEP - Java Expression Parser SourceForge Logo

Main  |  Samples  |  Documentation  |  Version Log  |  Forum  |  Download


Sample Applets


Function Plotter

Type a mathematical expression into the top line. The graph of the function of x will be plotted below. Note that scaling is 1:1.

The ploting of the curve does not require the equation to be parsed for each point. Instead, the parser "remembers" the structure of the expression and re-evaluates for different values of x. This causes a significant speed increase compared to parsing the expression for each point.

Try using constants (pi and e) and common functions (sin(x), cos(x), tan(x), asin(x)...) in your expressions to test the full functionality of the package.

Source Code

FunctionPlotter.java
GraphCanvas.java

  



Try the following sample expressions
(use cut and paste)

  • 80 e^(-((x/40)^2))
  • 20 ln(x/10)
  • 10 tan(x/30)
  • x^3 / 1e4
  • 50 sin(x/20)
  • 50 sin(x/10)*(sin(x/10) > 0)

 

Expression Evaluator

The following applet allows you to evaluate expressions with the varible "x". The result is displayed as a complex number (the first number is the real component, the second number is the imaginary component).

Use the constant "i" as the imaginary unit (square root of -1).

Source Code
Evaluator.java




:: © 2000 Nathan Funk