For a school project, I would like to make a website that allows the user to draw http://en.wikipedia.org/wiki/Knot_(mathematics)" [Broken]. In other words, I want to allow the user to draw many sided polygons (enough sides to approximate a curve) that are allowed to self intersect. There are two rules that apply to these polygons. First, only two segments are allowed to intersect at a single point, and second, at the intersection points there is one segment that goes over top and one segment that goes underneath. The user will need to be able to switch which segment is on top. After they draw the knot, I will extract some data from the drawing for some computations. Here is my question: Is there a good drawing tool that I could use for this? One that I could write my rules into without too much difficulty? Thanks Much!