diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2018-03-07 15:25:55 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2018-03-07 15:25:55 -0500 |
commit | a774e33ceff6c3eef02aad4f58a11c7e23ff62bb (patch) | |
tree | 36555d06322d4bea7ffe4bf572cf282db2989fcd /initrd/init | |
parent | 77338a6b34d6a164fc2f70e6d736eca8a5b7d251 (diff) |
basic graphing
Diffstat (limited to 'initrd/init')
-rw-r--r-- | initrd/init | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/initrd/init b/initrd/init index 4351743..56e5212 100644 --- a/initrd/init +++ b/initrd/init @@ -1 +1,37 @@ -print "Hello, world!" +func Fx + ret (arg0 * arg0) +end + +# graph area +set plotx 0 +set ploty 0 +set plotw 479 +set ploth 319 + +# graph range +set xmin (0 - 10) +set xmax 10 +set ymin (0 - 10) +set ymax 10 + +set xinc (plotw / (xmax - xmin)) +set yinc (ploth / (ymax - ymin)) + +# print axis +line 240 0 240 319 32767 +line 0 160 479 160 32767 + +# do function +set x xmin +set cx (plotx + (plotw / 2)) +set cy (ploty + (ploth / 2)) +do + Fx x > y + set y (0 - y) + if ((y > ymin) & (y < ymax)) + pixel (cx + (x * xinc)) (cy + (y * yinc)) 511 + end + set x (x + (1 / xinc)) +while (x < xmax) + +print "Done." |