private static double bezier(double t, double u1, double u2) {
    double v = 1 - t;
    return 3 * u1 * v * v * t + 3 * u2 * v * t * t + t * t * t;
  }
private static double bezier(double t, double u1, double u2)