Last active
December 20, 2015 23:08
-
-
Save tbates/6209846 to your computer and use it in GitHub Desktop.
Does a midwife or Jupiter exert more gravitational pull on a baby at birth?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Things you should learn in school: Be able to answer any question of the form: | |
# "Which has more gravitational pull on a baby as it is born: the midwife, or the planet Jupiter?" | |
# baby ~ 5 kg | |
# Distance and mass of [Jupiter](http://en.wikipedia.org/wiki/Jupiter) | |
gravitationalAttraction <- function(G = 6.674E-11, m1, m2, r){ | |
# G = 6.674E-11 # [Gravitational constant](http://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation): N m^2 kg^-2 | |
G * (m1 * m2)/r^2 | |
} | |
# 1.8986E27 kg of Jupiter @ 778E9 * .8 m (about 5.2 × the distance of earth from the sun, so say 80% of this | |
Fjupiter = gravitationalAttraction(m1 = 5, m2 = 1.8986E27, r = 778E9 * .8) | |
# 50 kg of midwife at 1m | |
Fmidwife = gravitationalAttraction(m1 = 5, m2 = 50, r = 1); # 50kg midwife @ 1m distance | |
c(Fmidwife = Fmidwife, Fjupiter = Fjupiter, PlanetMinuswife = Fjupiter - Fmidwife, ratio = Fjupiter/Fmidwife) | |
# How heavy a mid-wife do we need (at a distance of 1m?) | |
Fmidwife = gravitationalAttraction(m1 = 5, m2 = 4902, r = 1); # about 5 tons! | |
c(PlanetMinuswife = Fjupiter - Fmidwife, ratio = Fjupiter/Fmidwife) | |
# What if the midwife is really close? | |
Fmidwife = gravitationalAttraction(m1 = 5, m2 = 445, r = .3); | |
c(Fmidwife = Fmidwife, Fjupiter = Fjupiter, PlanetMinuswife = Fjupiter - Fmidwife) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment