Skip to content

Commit

Permalink
Cleaned up constants
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenbalaban committed Nov 17, 2014
1 parent 29a8639 commit 3bb970b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Gravity.elm
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@ metersPerPixel = solarSystemDiameter / 5000 -- meters / pixel
mercuryCapsuleMass = 2000 -- kg
cometMass = 2.2e14 -- Halley's comet's mass is 2.2e14 kg.
rocketAcc = 0.003755 -- m / s^2

rocketThrust : Float -- Newtons
rocketThrust = mercuryCapsuleMass * rocketAcc -- F = ma : (N)

-- The Gravitational Constant
gravitationalConstant = 6.67384 * 10e-11 -- m^3 / kg s^2

-- An Astronomical Unit (AU) is about the distance from the Sun to the Earth.
au = 149597870700 -- meters

earthMass = 5.97219 * 10e24
earthOrbitalVelocity = 300000

sunMass = 1.98855 * 10e30
sunOrbitalVelocity = 0
-- An Astronomical Unit (AU) is about the distance from the Sun to the Earth.
au = 149597870700 -- meters

rocketThrust : Float
rocketThrust = mercuryCapsuleMass * rocketAcc -- F = ma : (Newtons)


type Point a =
{ a | x : Float
Expand Down Expand Up @@ -73,6 +69,7 @@ comet pos vel =
generateBody pos vel cometMass lightRed 4 "" False

-- Physical Objects --

sun = generateBody { x=0, y=0 } { x=0, y=sunOrbitalVelocity }
sunMass lightYellow 30 "" False

Expand Down

0 comments on commit 3bb970b

Please sign in to comment.