g.Line(p1, p2)

Return a new line object with start at point p1 and end at point p2. p1 and p2 are first passed through the Point constructor so they can also be passed in string form. Examples:

var l = new g.Line(new g.Point(10, 20), new g.Point(50, 60));
var l = new g.Line('10 20', '50 60');
var l = new g.Line('10@20', '50@60');

The constructor also accepts a single Line object as an argument; it creates a new line with points cloned from the provided line.