2011-05-27

Technologies

I wrote mineConics in Javascript using jQuery to handle some of the interface elements.  The graph is drawn on a Canvas element and I used the mousewheel jQuery plugin so that users could zoom in and out with the graph.


At first I was using a very basic algorithm to calculate circles.  I tested every single cell on the graph against the list of circles.  If sqrt((x*x)+(y*y)) was less than or equal to the radius of the circle and greater than (radius - 1), fill in that cell.  This worked but it was slow and didn't allow for the click and drag panning that I had in mind.  I looked around for a more efficient algorithm and found Bresenham's Circle Algorithm.  I don't think Bresenham wrote the circle algorithm, but he wrote the line-drawing algorithm that inspired it.  This sped everything up and allowed me to make the app much more interactive.


I'm using Google App Engine to host the site.  I might take advantage of their backend storage to save designs or I might save them locally using HTML5.  I haven't gotten around to that yet, but I'll keep you posted.

No comments:

Post a Comment