I’m using RaphaelJS to draw a set of shapes at random positions on the paper, using this code:
http://jsbin.com/ixiqiy/2/edit
What I’m trying to do now is find the outermost set of positions, so that I can draw a border around the whole group. For example:

Can anyone help? Thanks.
OK, so using the Jarvis March algorithm and this python implementation I’ve managed to put together my own JS/RaphaelJS solution, which can be found here: http://jsbin.com/ixiqiy/12/edit.
Just in case that ever disappears, here’s the code: