lineInter = function(a, b, c, d) {
    //test ab<->cd intersection
    var denom = (d.y - c.y) * (b.x - a.x) - (d.x - c.x) * (b.y - a.y);
    var aycy = (a.y - c.y), axcx = (a.x - c.x);
    var p = ((d.x - c.x) * aycy - (d.y - c.y) * axcx) / denom;
    var t = ((b.x - a.x) * aycy - (b.y - a.y) * axcx) / denom;

    return (p > 0 && p < 1 && t > 0 && t < 1);
  }
Test polygon<->polygon intersection based on the triangulations.
TODO: Could be optimized, but seems to be performing very well.
@param {!weapi.Polygon} other .
@return {boolean} True if the two polygons overlap.