code: private Force computeVector(Force vector, Localizable target)
      {
          final double sx = localizable.getX();
          final double sy = localizable.getY();
  
          double dx = target.getX();
          double dy = target.getY();
  
          if (target instanceof Transformable)
          {
              final Transformable transformable = (Transformable) target;
              final double ray = UtilMath.getDistance(localizable.getX(),
                                                      localizable.getY(),
                                                      target.getX(),
                                                      target.getY());
              dx += (int) ((target.getX() - transformable.getOldX()) / vector.getDirectionHorizontal() * ray);
              dy += (int) ((target.getY() - transformable.getOldY()) / vector.getDirectionVertical() * ray);
          }
  
          final double dist = Math.max(Math.abs(sx - dx), Math.abs(sy - dy));
  
          final double vecX = (dx - sx) / dist * vector.getDirectionHorizontal();
          final double vecY = (dy - sy) / dist * vector.getDirectionVertical();
  
          final Force force = new Force(vector);
          force.setDestination(vecX, vecY);
  
          return force;
      }
docs: Compute the force vector depending of the target.
  
  @param vector The initial vector used for launch.
  @param target The target reference.
  @return The computed force to reach target.