g.js — graphical objects for JavaScript

quadquad

Create a four-sided polygon from points.

var pt1 = {x: -100, y: -50};
var pt2 = {x: 100, y: -10};
var pt3 = {x: 100, y: 50};
var pt4 = {x: -100, y: 10};
g.quad(pt1, pt2, pt3, pt4);

Parameters

  • point1: The first point.
  • point2: The second point.
  • point3: The third point.
  • point4: The fourth point.