Skip to content
Snippets Groups Projects
Commit a5286649 authored by Michael Leuschel's avatar Michael Leuschel
Browse files

make example a bit nicer

parent 4b6e8dfb
No related branches found
No related tags found
No related merge requests found
...@@ -8,10 +8,18 @@ DEFINITIONS ...@@ -8,10 +8,18 @@ DEFINITIONS
FORMAT_TO_STRING("~w,~w ",[real(i), points(i)]))); FORMAT_TO_STRING("~w,~w ",[real(i), points(i)])));
// the function to be plotted: // the function to be plotted:
myfunction(x) == 2.0*RSQRT(x)-0.5*RSIN(2.0*x); myfunction(x) == 1.5*RSQRT(x)-0.5*RSIN(2.0*x);
mypoints(scale) == %x.(x:1..500| 300.0-scale*myfunction(RDIV(real(x),scale))); // proportions of the SVG frame
WIDTH == 500;
HEIGHT == 300;
// graph plotted in rectangle (0,0) to (300,300) mx_x == 10.0; // maximum x value computed
visb_graph == svg_points2str(mypoints(30.0))
// compute a sequence of function values:
mypoints(scale) == %x.(x:1..WIDTH| real(HEIGHT) -
scale*myfunction(RDIV(real(x),scale)));
// graph plotted in rectangle (0,0) to (500,300)
visb_graph == svg_points2str(mypoints(RDIV(real(WIDTH),mx_x)))
END END
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment