http://www.c-point.com/javascript_vector_draw.htm