g.line(p1, p2)
Return a new line object with starting at point p1
ending at point p2
. p1
and p2
are first passed through the point
constructor so they can also be passed in the string forms. Examples:
var l = g.line(g.point(10, 20), g.point(50, 60));
var l = new g.line('10 20', '50 60');
var l = g.line('10@20', '50@60');