code: function solveIntersection (a, b, c, d) {
    var ba = rvSub(b, a)
    var dc = rvSub(d, c)
  
    var baXdc = ratPerp(ba, dc)
  
    if (ratSign(baXdc) === 0) {
      return null
    }
  
    var ac = rvSub(a, c)
    var dcXac = ratPerp(dc, ac)
  
    var t = ratDiv(dcXac, baXdc)
    var s = rvMuls(ba, t)
    var r = rvAdd(a, s)
  
    return r
  }
docs: Solve for intersection x = a + t (b-a) (x - c) ^ (d-c) = 0 (t * (b-a) + (a-c) ) ^ (d-c) = 0 t * (b-a)^(d-c) = (d-c)^(a-c) t = (d-c)^(a-c) / (b-a)^(d-c)