Lab 06 - SpaceVoyage1

Lab 06 - SpaceVoyage1 - from _future_ import division from...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
from __future__ import division from visual import * scene.width =1024 scene.height = 760 #CONSTANTS G = 6.7e-11 mEarth = 6e24 mcraft = 15e3 deltat = 480 pscale = .5 #OBJECTS AND INITIAL VALUES Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan) # Choose an exaggeratedly large radius for the # space craft so that you can see it! craft = sphere(pos=vector(-10*Earth.radius, 0,0), radius=3.2e6, color=color.yellow) vcraft = vector(0,2000,0) pcraft = mcraft*vcraft parr = arrow(color=color.green) r = craft.pos - Earth.pos rmag = sqrt(r.x**2 + r.y**2 + r.z**2) rhat = r / rmag trail = curve(color=craft.color) ## craft trail: starts with no points t = 0 scene.autoscale = 0 ## do not allow camera to zoom in or out #CALCULATIONS while t < 10*365*24*60*60: rate(200)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online