Simulation of two hemispheres Bell experiment

This simulates the experiment proposed by Joy Christian in http://arxiv.org/abs/0806.3078
Further information about this simulation can be found at http://quantropy.org/13/



There are two hemispherical shells, each with a mass at a random position on the shell. The masses are small in size, but of comparable mass to the shell. Initially the two shells are joined together into a sphere. They are then given an impulse so that they move apart as well as being given equal and opposite angular momenta. They are measured by two detectors A and B, which have directional settings a and b, each of which is a unit vector.
The simulation has a variable number of trials per run, initially set at 1000. Each run has the detector settings chosen at random at the start. The simulation is set to stop after 1000 runs have been completed, but will start again from the beginning if the 'Restart' button is pressed. Each trial takes about 10 seconds, so to complete a run takes several hours.
While writing this program I realised that it was largely unnecessary. Since angular momentum is conserved, the only role the hemispheres play is to carry fixed quantities to the detectors. With this in mind I made it possible to skip the animation stage, by unchecking the 'Show Animation' box, and calculate the correlation directly from the initial anugular momenta and detector settings.