Debian Codegraph @

tests/batman_plot

raw
1
2 ; These are the Batman equations.
3 ; They plot the Batman logo using many absolute value functions.
4 ; This is a good test of absolute value simplification.
5 ; To read in, install m4 Mathomatic and type "rmath batman_plot".
6
7 y=1.5*sqrt((-abs(abs(x)-1))*abs(3-abs(x))/((abs(x)-1)*(3-abs(x))))*(1+abs(abs(x)-3)/(abs(x)-3))*sqrt(1-(x/7)^2)+(4.5+0.75*(abs(x-0.5)+abs(x+0.5))-2.75*(abs(x-0.75)+abs(x+0.75)))*(1+abs(1-abs(x))/(1-abs(x)))
8 y=(-3)*sqrt(1-(x/7)^2)*sqrt(abs(abs(x)-4)/(abs(x)-4))
9 y=abs(x/2)-0.0913722*x^2-3+sqrt(1-(abs(abs(x)-2)-1)^2)
10 y=(2.71052+1.5-0.5*abs(x)-1.35526*sqrt(4-(abs(x)-1)^2))*sqrt(abs(abs(x)-1)/(abs(x)-1))
11 ; Type "plot all" to see the batman logo.
12 ; Test the simplify command by typing "repeat simplify all"
13 ; then "plot all" again, making sure it is exactly the same plot.