line(x1, y1, x2, y2)

Draws a line (a direct path between two points) to the page.

Type: function

Parameter(s):

  • x1 {Number}:

    X-coordinate of Point 1.

  • y1 {Number}:

    Y-coordinate of Point 1.

  • x2 {Number}:

    X-coordinate of Point 2.

  • y2 {Number}:

    Y-coordinate of Point 2.

Returns:

  • {GraphicLine}:

    New GraphicLine.

Example(s):

var vec1 = new Vector(x1, y1);
var vec2 = new Vector(x2, y2);
line( vec1, vec2 );