"""Derive Cavendish's constant 10683 from the numbers he states in 'On the Method of computing the Density of the Earth' (Phil. Trans. 88, 1798, pp. 509-511):
arm 73.3 in between ball centres (36.65 in from the centre of motion); seconds pendulum 39.14 in; scale at 38.3 in with divisions of 1/20 in;
weights of 10.64 spherical feet of water, centres 8.85 in from the middle line, geometric factor 0.9779; mean diameter of the Earth 41,800,000 ft.
Result: D = N^2 / (10683 * B) uncorrected; the corrections (arm inertia, attraction on the arm, far ball, copper rods, case, arm position) then lower the printed
value by a factor close to 0.985 on every row we checked. I read the stated numbers from the scan/OCR; the derivation is mine."""
r, L_sec, scale_in, div_in = 36.65, 39.14, 38.3, 1 / 20.0
angle_per_div = div_in / scale_in                    # radians, ~1/766
print('angle per division = 1/%.1f' % (1 / angle_per_div))
# a pendulum of length l swings (one 'vibration') in sqrt(l/39.14) s, so N s <=> l = 39.14 N^2; force/weight = angle * r / l
force_per_div_over_N2 = angle_per_div * r / L_sec     # = 1/(818 N^2)
print('force per division / weight = 1/(%.1f N^2)' % (1 / force_per_div_over_N2))
sph_ft = 10.64 * 0.9779 * (6.0 / 8.85) ** 2           # weight's attraction on the ball over a 1-ft water sphere's surface attraction
earth_ratio = 41.8e6 / sph_ft                         # = 8,739,000 (so attraction = weight_of_ball / (8,739,000 D))
print('attraction of weight on ball = weight_of_ball / (%.0f D)   [his text: 8,739,000]' % earth_ratio)
const = earth_ratio / (1 / force_per_div_over_N2)
print('=> D = N^2 / (%.0f B)   [his text: 10683]' % const)
