code: public static double lerp(double x, double x1, double x2, double q0, double q1) {
          return ((x2 - x) / (x2 - x1)) * q0 + ((x - x1) / (x2 - x1)) * q1;
      }
docs: Calculates the value at x using linear interpolation
  
  @param x the X coord of the value to interpolate
  @param x1 the X coord of q0
  @param x2 the X coord of q1
  @param q0 the first known value (x1)
  @param q1 the second known value (x2)
  @return the interpolated value