Here's my numerical approximation approach. It's assuredly buggy it minor ways (don't try to stick the point you want a force for directly on the torus's surface since you end up with zero distance leading to massive absurd gravitational forces), but I think it's otherwise basically accurate.
Language: python
## Torus major radius
majorRad = 10
## Torus minor radius
minorRad = 1
## Number of rings of the torus to create
circumDivisions = 1000
## Number of points in each ring
ringDivisions = 100
## Mass of a point on the torus
# (so total mass = torusMass * circumDivisions * ringDivisions)
# Compare Earth at ~10^24kg
torusMass = 10 ** 19
## Mass of the point we calculate gravity for
targetMass = 1
## Gravitational constant
G = 6.67428 / (10 ** 11)
## Point to calculate gravity for
targetCenter = (0, 8.9999, 0)
import math
points = []
for i in xrange(circumDivisions):
theta = i / float(circumDivisions) * math.pi * 2
for j in xrange(ringDivisions):
phi = j / float(ringDivisions) * math.pi * 2
temp = majorRad + minorRad * math.cos(phi)
x = temp * math.cos(theta)
y = temp * math.sin(theta)
z = minorRad * math.sin(phi)
points.append((x, y, z))
gravyVector = [0, 0, 0]
for point in points:
delta = [point[i] - targetCenter[i] for i in xrange(3)]
distanceSquared = sum([d ** 2 for d in delta])
force = G * torusMass * targetMass / distanceSquared
distance = math.sqrt(distanceSquared)
# Normalize delta to get direction
direction = [d / distance for d in delta]
for i in xrange(3):
gravyVector[i] += direction[i] * force
for i in xrange(3):
gravyVector[i] = gravyVector[i] / len(points)
if abs(gravyVector[i]) < 1:
# Cleaner display
gravyVector[i] = 0
# Approximate gravitational force on Earth's surface is 5.5 * 10^9 newtons.
print "An object at",targetCenter,"would experience a force of",gravyVector,"newtons in X, Y, and Z"
I made the torus have approximately the same mass ratio to a human as the Earth has. Some sample output was here, but I redacted it after realizing my positions were all off ([9, 0, 1] is not on the torus). Here's some updated results:
An object at (0, 0, 0) would experience a force of [0, 0, 0] newtons in X, Y, and Z
An object at (0, 0, 0.001) would experience a force of [0, 0, -672.48108917887703] newtons in X, Y, and Z
An object at (0.001, 0, 0) would experience a force of [336.24055346705705, 0, 0] newtons in X, Y, and Z
An object at (8.9990000000000006, 0, 0) would experience a force of [6681569642.6716862, 0, 0] newtons in X, Y, and Z
An object at (11.000999999999999, 0, 0) would experience a force of [-6687714835.3757915, 0, 0] newtons in X, Y, and Z
An object at (10, 0, 1.0009999999999999) would experience a force of [-4100004.7859800849, 0, -6685114396.9591808] newtons in X, Y, and Z
Thus, the center point is stable in Z but unstable in X and Y -- no surprises there. Also, no matter where you stand on the ring, the primary force will be "down" to the ground. When standing on the "top" of the ring there's a horizontal force pulling you towards the torus's center of mass, but it's ~1500 times weaker than the downward force. Overall the downward force only varies by about a tenth of a percent for this torus.