private static float pointIntersectsMovingPointDetection(
         float p1X, float p1Y, float p1SpeedX, float p1SpeedY, float p1Radius, 
         float p2X, float p2Y, float p2SpeedX, float p2SpeedY, float p2Radius) {
      
      // Rearrange the parameters to set up the quadratic equation.
      double centerX = p1X - p2X;
      double centerY = p1Y - p2Y;
      double speedX = p1SpeedX - p2SpeedX;
      double speedY = p1SpeedY - p2SpeedY;
      double radius = p1Radius + p2Radius;
      double radiusSq = radius * radius;
      double speedXSq = speedX * speedX;
      double speedYSq = speedY * speedY;
      double speedSq = speedXSq + speedYSq;
   
      // Solve quadratic equation for collision time t
      double termB2minus4ac = radiusSq * speedSq - (centerX * speedY - centerY * speedX)
            * (centerX * speedY - centerY * speedX);
      if (termB2minus4ac < 0) {
         // No intersection.
         // Moving spheres may cross at different times, or move in parallel.
         return Float.MAX_VALUE;
      }
      
      double termMinusB = -speedX * centerX - speedY * centerY;
      double term2a = speedSq;
      double rootB2minus4ac = Math.sqrt(termB2minus4ac);
      double sol1 = (termMinusB + rootB2minus4ac) / term2a;
      double sol2 = (termMinusB - rootB2minus4ac) / term2a;
      // Accept the smallest positive t as the solution.
      if (sol1 > 0 && sol2 > 0) {
         return (float)Math.min(sol1, sol2);
      } else if (sol1 > 0) {
         return (float)sol1;
      } else if (sol2 > 0) {
         return (float)sol2;
      } else {
         // No positive t solution. Set detected collision time to infinity.
         return Float.MAX_VALUE;
      }
   }