Mathray is a general-purpose high-quality mathematical plotter.
Mathray requires java and maven to be installed.
Mathray can be run in one of two ways:
- For *nix platforms, use the ./mathray driver script
- For other platforms, pay attention to the java command in the script. Use
dependency:build-classpath
to find the appropriate classpath. The final command will be something like:
java -cp target/mathray-0.01-SNAPSHOT.jar:{big_long_maven_classpath} mathray.cli.Main
The usage statement is pretty self-explanatory:
usage: mathray --plot "" -h,--height height of output in pixels --help print this message --output file to write result to --plot function or equation to plot -w,--width width of output in pixels --xa lowest (left-most) x value visible in output --xb highest (right-most) x value visible in output --ya lowest y value visible in output (near bottom) --yb highest y value visible in output (near top)
Specifying a function in x causes mathray to plot using a very simple and fast function plotter:
./mathray --plot "sin(x)"
./mathray --plot "log(x)+2/3*sin(2x * tau)
Notice the "tau" constant, the real circle constant (see tauday.com). Mathray also supports plain-old pi and e.
Specifying an equation in x and y causes mathray to plot using an interval arithmetic solver:
./mathray --plot "y^2*(y^2-(8/10)^2)=x^2*(x^2-1)"
Specifying an equation in x, y, and z causes mathray to plot using a 3D ray-tracer (or a direct analog thereof):
./mathray --plot "x^2+y^2=(1-z)*z^4"