text: In the situation of a spacecraft or comet approaching a planet, the impact parameter and excess velocity will be known accurately. If the central body is known the trajectory can now be found, including how close the approaching body will be at periapsis. If this is less than planet's radius an impact should be expected. The distance of closest approach, or periapsis distance, is given by:
  So if a comet approaching Earth (effective radius ~6400 km) with a velocity of 12.5 km/s (the approximate minimum approach speed of a body coming from the outer Solar System) is to avoid a collision with Earth, the impact parameter will need to be at least 8600 km, or 34% more than the Earth's radius. A body approaching Jupiter (radius 70000 km) from the outer Solar System with a speed of 5.5 km/s, will need the impact parameter to be at least 770,000 km or 11 times Jupiter radius to avoid collision.
  If the mass of the central body is not known, its standard gravitational parameter, and hence its mass, can be determined by the deflection of the smaller body together with the impact parameter and approach speed. Because typically all these variables can be determined accurately, a spacecraft flyby will provide a good estimate of a body's mass.