Creating online line using canvas

how can i a create a line between two dynamic point using canvas...
and also a want to have a point in middle of line for give curvature to it...
something like this shape with an ability to change zeros position....
0-------0--------0