Graphing

For Scientific Computing, I decided I wanted to have a grapher with which I could programmatically interface easily. Of course, there are options other there, from gnuPlot to you-name-it, but I figured that it wouldn’t be too hard to write one myself. Especially since there’s a ruby port for OpenGL.

Long story short, I’ve got something that’s not too terrible. Not perfect, but it’s certainly a start:

A few functions plotted with my grapher

A few functions plotted with my grapher

But then, I thought, “why stop there?” I figured it wouldn’t be that hard to make a 3D version. While the 2D one will work on any generic function you give it, this 3D one has it hard-coded in right now. Of course, it wouldn’t be too much more to make it more flexible, but given that this took 30 minutes, I’m ok with its rigidity.

A simple surface.

A simple surface.

We’ll see where this goes. It makes me feel a little nerdy that I’m two days into my winter break, and this is how I’ve spent some of it.

Tagged with:
 

2 Responses to “Graphing”

  1. Matt M says:

    That’s sweet Dan!

  2. Didier Lecocq says:

    Sweet Dan,
    You said it – if you are really bored there is a gas line to run for the shop!

Leave a Reply