3. Gravitation in Three Dimensions: the Cube and the Sphere
The extension from two to three dimensions is direct, and the equations need no further comment. The only problem we run into in three dimensions is the large number of segments needed to model a three-dimensional object. We will deal here with the simpler problem of the field set up by a three-dimensional object, i.e. the force it exerts on a unit point mass, and again we will express the result as a multiple of the result for the mass concentrated at the center. The important result we wish to demonstrate is that the field of a sphere is the same as that of a point mass. If we find this to be true, then we expect the field of a cube, along a line from its center perpendicular to a face, to be lower than the field of an equivalent point mass. The program to do the calculation for a cube and a sphere is a direct extension of the two-dimensional program. In some ways it is simpler, because only one component of the field need be calculated, and symmetry lets us sum over only one-quarter of the cube. (A cube has more than four-fold symmetry, but it is best to avoid subdivisions which have mass points on the surface.) Each octant of the cube is subdivided into a 20 x 20 x 20 array, and the field is calculated at a distance equal to the cube edge (diameter for a sphere) from the center. For a sphere, mass points more than one radius from the center are excluded from the sum.
For a sphere, the numerical calculation gives a result close to that for a point mass, and for a cube it gives a result lower than that for a point mass.