To calculate the gravitational field of an object, such as a black hole, the formula used is \vec{g} = \frac{GM_1}{r^2} \hat{r}, which incorporates the object's mass and distance from the center. For non-spherical mass distributions, it's necessary to integrate this equation by replacing mass with small elements (dm) and relating these to the object's geometry through density. The principle of superposition is crucial, as it allows for the summation of the gravitational fields generated by each dm. Clarification on the specific geometry or density function can lead to a more tailored calculation. Understanding these principles is essential for accurately determining gravitational fields in complex scenarios.