function midPoint(a, b, t) {
  const [ax, ay] = a; const [bx, by] = b;
  return [ax + (bx - ax) * t, ay + (by - ay) * t];
}
Returns the coordinates of a specified distance
ratio between two points.

@param {[number, number]} a the first point coordinates
@param {[number, number]} b the second point coordinates
@param {number} t the ratio
@returns {[number, number]} the midpoint coordinates