fork/numbat

git clone https://git.julia.blue/fork/numbat

David PeterAdd short+long aliases for most phys. constantsa2be63f

v1.6.1
355 B15 linesraw
1# Gravity wells
2#
3# https://xkcd.com/681/
4
5fn depth(mass: Mass, radius: Length) -> Length =
6    G × mass / (g0 × radius) -> km
7
8let earth_mass = 5.972e24 kg
9let earth_radius = 6371 km
10
11let moon_mass = 7.342e22 kg
12let moon_radius = 1737 km
13
14assert_eq(depth(earth_mass, earth_radius), 6379 km, 1 km)
15assert_eq(depth(moon_mass, moon_radius), 288 km, 1 km)