This reminds me of my favourite Windows application ever: EvalDraw.
It's like this, except that beyond drawing single-argument f(x) -> y functions, it also draws f(x, y) -> z heatmaps, f(x, y) -> (R, G, B) colored heatmaps, f(x, y, z) -> (R, G, B) volumetric 3D graphics, and all these have also a f(..., t) -> ... variant for animations. And then you dig in and discover it somehow also has keyboard & mouse input handling, can play sounds (and can be used for live procedural music), simulate a piano keyboard, and probably a bunch of other stuff I'm forgetting. It was my go-to tool for visualizing any kind of math back during the university years.
In fact, I just took a look at it again (after not using it for years) and I discovered it has networking capability, IDE features, and - I kid you not - it seems to compile the scripts down to native code, offering a helpful x86 ASM output in the built-in debugger. It can dump executables, has bindings to OpenGL and support for old-school VR (colored stereoscopic, NVidia 3DVision).
All in an executable that weighs 746 KB.
It's hands-down one of the most impressive pieces of software I have ever seen.
EDIT: And if you give it a try, be sure to check some of the ridiculous amount of examples it comes bundled with, which include games, explorable explanations, infinite calendars, optical systems simulations, and a whole host of other stuff.
Apparently John Carmack thought highly of Ken's programming, too:
"Carmack: Well there's a big difference between who I consider the most talented and who I would necessarily hire, because you have to hire people that fit right. If I had to pick who I think is just the most talented, it would probably be Ken Silverman, the guy that did the BUILD engine. He does engines and tools. He's great as an editor. He writes all the code for everything, and he's just extremely talented. I think it was 3D Realms' worst decisions not to coddle him, or whatever it took, to keep him on board. I think if he was still working directly for 3D Realms, they would have a Quake-type game shipped by now, just because he's extraordinarily good."
(Kind of a tangent, but this reminds me of Red lang and Factor lang. Both are tight, tiny (by modern standards), self-contained, and produce native code. I wish some other languages (like Haskell and Python) had similar setups. "That would be sooo cooool.")
It's not the same technique. That article is describing how to plot functions when drawing them using fragment shaders, via the vertical y-axis distance to the function. So to get a constant width line you have to compensate for the slope of the line. Graph Toy is using line drawing to render the function plots, and samples the function once for every pixel horizontally, so the line width issue it taken care of. It's very easy to pop open your dev tools panel and read the source code, BTW, it's not minified or obfuscated. The drawing routine is called draw().
If the author is here -- the extra features compared to IQ's version are nice! I might make this my bookmarked default version.
If interested, here are a few thoughts:
- It might be good to link directly to IQ's version of GraphToy, rather than his homepage.
- I dig the white background option!
- The create link feature is a bit smoother than the original.
- The download image button is a great idea, though I just realized with both versions you can right click to save the image, without needing a new tab. One thing that occurred to me -- it would be killer if the download image version popped up an SVG render with a higher sampling rate, instead of pixels! A little text or UI could clarify how to save a pixel version vs a vector rendering.
- I like the escalator function used to demo the time variable! I've used that very function on ShaderToy.
- It would be super nice if the plot window used a flexbox or grid layout to stretch to fill the window. It's currently a bit smaller than IQ's and doesn't resize.
- Might also be nice to have the help box be a popup you can click (the way it works in ShaderToy), and maybe put the variables underneath the plot, to allow the plot to expand to basically full screen?
There was a hypnotic graphic effect on my phone. As the wave phased between modes it appears to be a smooth wave after a threshold (graph sample aliasing?), a cyclic standing envelope like angular frequency, in t. Quite nice.
Not only that, but it's extraordinarily capable as a graphing app (and comes with examples demonstrating its features), too! It also has a pretty crazy history: https://news.ycombinator.com/item?id=1584501
Interesting, I had no idea that Grapher existed. Looks like it is only the spiritual successor to the classic MacOS Graphing Calculator, not an actual continuation by the original developers: https://en.wikipedia.org/wiki/Grapher
It's like this, except that beyond drawing single-argument f(x) -> y functions, it also draws f(x, y) -> z heatmaps, f(x, y) -> (R, G, B) colored heatmaps, f(x, y, z) -> (R, G, B) volumetric 3D graphics, and all these have also a f(..., t) -> ... variant for animations. And then you dig in and discover it somehow also has keyboard & mouse input handling, can play sounds (and can be used for live procedural music), simulate a piano keyboard, and probably a bunch of other stuff I'm forgetting. It was my go-to tool for visualizing any kind of math back during the university years.
In fact, I just took a look at it again (after not using it for years) and I discovered it has networking capability, IDE features, and - I kid you not - it seems to compile the scripts down to native code, offering a helpful x86 ASM output in the built-in debugger. It can dump executables, has bindings to OpenGL and support for old-school VR (colored stereoscopic, NVidia 3DVision).
All in an executable that weighs 746 KB.
It's hands-down one of the most impressive pieces of software I have ever seen.
http://advsys.net/ken/download.htm#evaldraw
EDIT: And if you give it a try, be sure to check some of the ridiculous amount of examples it comes bundled with, which include games, explorable explanations, infinite calendars, optical systems simulations, and a whole host of other stuff.