I have put together a nice little physics engine which can be also used as a ragdoll physics engine if a human like character is put in. i am curently programming this into a game to throw the character back when a bomb explodes. it is not very well commentated and it's not indented but you can understand it because it is laid out simply. it uses pythagoras' theroem to check if the lines are the right length that they should be and you can delete the character on there and put in more lines if you want as long as they are in the array line1(). lines will make a joint if you place the two ends next to eachother and you can click on the end of a line to pick it up and drag it around then click again to drop. i think thats it. any comments, suggestions, improvements post here
by the way, in some situations it does not mimic what an object would do IRL, Triangles especially do some wierd things, eg balancing miraculously, turning inside out and flinging across the form as a result, and basically spasming every now and then to create A PERPETUAL MOTION DEVICE! (even though theres FRICTION!) which is of course not possible.
if anyone knows how i could improve this and get it to behave like it would in real life better then post here please