earth_mass.nbt 231 B

12345678
  1. # Compute the mass of planet earth
  2. let radius: Length = 6000 km
  3. let volume: Volume = 4/3 · π · radius³
  4. let ρ: MassDensity = 5000 kg/m³
  5. let earth_mass: Mass = ρ · volume
  6. assert_eq(earth_mass, 4.52389e24 kg, 0.00001e24 kg)