title: Essential algorithms for drawing, dragging, dropping and overlapping shapes on a cartesian plane
body: <p>I am planning to build an HTML 5 application that is able to draw shapes on an HTML 5 canvas  element.</p>
  
  <p>My project aims to create a sort of diagramming tool that will make use of rectangles, triangles, circles, lozenges and lines among all of them, where the user will be able to resize and reposition the shapes at any time.</p>
  
  <p>There are many tools in the market that implement this kind of logic. We can find it in many diagramming tools that were implemented in many different programming languages over the years. Products like MS Vision, OmniGraffle, Rational Rose, the old ERWin and so on.</p>
  
  <p>So I am wondering if there are any well known (generic) algorithms in the computer science field targeted to the tasks of drawing, resizing, dragging, dropping, and consequently redrawing, shapes on a Cartesian plane, that I should study before writing my own algorithms from scratch.</p>
  
  <p>Any reference will be welcome.</p>