-
-
Save restrepo/1895375 to your computer and use it in GitHub Desktop.
Revisions
-
rescolo revised this gist
Feb 23, 2012 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ #!/usr/bin/env python #From arXiv:1107.5216 from __future__ import division from visual import * @@ -28,4 +30,4 @@ trail.append(pos = craft.pos) t = t + deltat print 'Craft final position: ', craft.pos, 'meters.' -
llimllib revised this gist
Aug 4, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,6 @@ craft.pos = craft.pos + pcraft/mcraft*deltat trail.append(pos = craft.pos) t = t + deltat print 'Craft final position: ', craft.pos, 'meters.' -
llimllib revised this gist
Aug 2, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ mEarth = 5.97e24 vcraft = vector(0,2400,0) pcraft = mcraft*vcraft t = 0 deltat = 60 -
llimllib created this gist
Aug 2, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ from __future__ import division from visual import * craft = sphere(pos = vector(10e7,0,0), color = color.white, radius = 1e6) Earth = sphere(pos = vector(0,0,0), color = color.blue, radius = 6.3e6) trail = curve(color = craft.color) G = 6.67e-11 mcraft = 1500 mEarth = 5.97e24 vcraft = vector(0,2400,0) pcraft = ncraft*vcraft t = 0 deltat = 60 tf = 365*24*60*60 while t < tf: r = craft.pos-Earth.pos rhat = r/mag(r) Fgrav = -G*mEarth*mcraft/mag(r)**2*rhat pcraft = pcraft+Fgrav*deltat craft.pos = craft.pos + pcraft/mcraft*deltat trail.append(pos = craft.pos) t = t * deltat print 'Craft final position: ', craft.pos, 'meters.'