When a distance is posted on the scoreboard or on your television set after a home run is hit, it has been computed in one of two different ways. The most common way uses a mathematical formula first used in 1988 by IBM in a program called "Tale of the Tape." The calculation starts with a large architectural map of the baseball stadium. This map is extremely detailed as to distances, heights and other figures relating to obstructions that a ball might hit on its downward arc. The distance calculated is the distance the ball would have traveled if it hadn't hit any obstruction.
Let's suppose a home run is hit into the center field bleachers. Here's how the distance is calculated:
 A spotter marks the exact location where the ball fell on the map. A horizontal distance from home plate can be easily measured by the spotter since the map is of a certain scale. Let's say the horizontal distance was 410 feet.
 The spotter calculates the remainder of the distance that the ball would have traveled if it hadn't hit the stands. When the spotter marks the ball's location on the map, the map shows the elevation of that particular section of the stadium above home plate.
 The third component is a subjective call. The spotter must decide into which of three categories the home run fits:
 Line drive
 Normal fly
 High fly
Each of the three categories has a particular cotangent value attached to it. Line drive is 1.2, normal fly is 0.8, and high fly is 0.6. In nonmathematical terms, the cotangent value approximates how many feet the ball would travel horizontally for each foot in elevation that the ball hit above ground. Using our example, let's suppose that the elevation was 58 feet above home plate and that the home run was classified as being a normal fly. To calculate the "Tale of the Tape," we use the equation:
horizontal distance + (elevation * cotangent value) = total distance
In our example, this comes out to a distance of 456.4 feet (410 + [58 * 0.8]).
Despite being a mathematical method, the "Tale of the Tape" is still just a best estimate. SportVision, the same company who introduced the virtual firstdown line, has introduced a scientific procedure for measuring homerun distances that ESPN has dubbed "True Track." The system uses two specialized cameras to track the location of the baseball as it flies through the air. The cameras, after being calibrated with known points on the field, can produce a virtual 3D grid and calculate where the ball is in relation to that grid. A final homerun distance is then calculated using the position of the ball and the position of home plate in the grid.
Here are some interesting links:
