code: function interpolateY (x, x0, y0, x1, y1) {
    return (y0 + (((x - x0) * (y1 - y0)) / (x1 - x0))) || 0; // avoid NaN
  }
docs: given two points on a line and an x coordinate between them, compute the corresponding Y. https://en.wikipedia.org/wiki/Linear_interpolation