1977, my senior year at Roosevelt High School, Seattle Washington, on the third floor, in Mr. Erickson’s math classroom lived a state-of-the-art Wang-600 Programmable Desktop Calculator:

640 words of memory. Not 640K or Megabytes, 640 words. It could graph mathematical formula, play tic-tac-toe and generate random numbers. I learned to program on the Wang and the flatbed plotter was the *bomb.*

My pièce de ré·sis·tance was a program that drew 3D-Graphs, like this:

This work was exciting and got me an A in Programming as well as trigonometry (go figure). I learned about divide-by-zero errors, off-by-one errors and accumulated rounding errors. The plotter exposed me to the concept of APIs.

However, it was simplistic, it just drew several 2D graphs with their starting position offset by a fixed an increment. None of the calculated values were saved (no memory to do that kind of stuff) and, well, it worked. This was Version 1.0.

It took ten to fifteen minutes to finish one full graph.

Fast forward to 1984 when I snagged my boss’ Turbo Pascal 1.0 disk and loaded it on my brand new IBM AT (running at 6 megahertz). My first project was to recreate my 3D graphing program which I did in color and now took only five minutes to draw a screen. Yet this was still version 1.0, just in a different language, on a different platform.

At this time, the CEO and founder of the company was asking other Programmers if they would be interested in joining the Department of New Technology where they were starting a new product line, a deviation from our COBOL products, *written in C*. I left my 3D graphs displayed on my monitor while I was away from my desk for everyone to see. So, when it came to recruiting me they didn’t even ask me if I was interested, they just told me “Your new desk and computer is over here and here is a book on Programming in C. Start.” I attribute some of the expediency on my 3D program.

2021 Comes around I decided to recreate it yet again but this time in JavaScript! With modern computer power I can draw a much higher resolution graph in a fraction of a second:

The JavaScript development process is very streamlined; edit-test-edit-test, no edit-build-link-start-the-debugger-test. Excitingly fast. This environment also allowed me access to more memory and processor power than ever before so I moved on to Version 2.0; first calculating the x,y,z values then rendering them. I had envisioned this as the ‘right’ way to do it back in 1983 when I first dipped my toes into programming C on a Unix box powered by an 8086 with 512K of memory but my work was interrupted and it never came to fruition.

The modern environment of Windows10, the FireFox browser and gigabytes of memory allowed me to do it the ‘right’ way.

Not stopping there I enhanced it, drawing the perpendicular lines too:

This had vexed me until now but the whole idea of first calculating a grid of values and rendering the points allowed this. But then I got it to hide the lines you shouldn’t be able to see if it were a real 3D shape:

This really excited me. I call this Version 3.0. I uploaded it to my web site (http://www.brianroys.com/3D-Graphs.html) and you can run it on your own computer or even your phone! It isn’t just a picture like the above but your browser is actually calculating the X,Y,Z values and rendering the graph you see! 10,000 values. On your phone!

You can change the Z scale by hitting the ‘Z’ or ‘z’ keys (or using the buttons) and it will re-render the graph! On your phone!

I’m continuing to enhance it so stay tuned.

## Leave a Reply

You must be logged in to post a comment.