Lab 07 - SpaceVoyage3

Lab 07 - SpaceVoyage3 - from _future_ import division from...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
from __future__ import division from visual import * from visual.graph import * ## invoke graphing routines scene.y = 400 # move orbit window below graph scene.width =1024 scene.height = 760 #CONSTANTS G = 6.7e-11 mEarth = 6e24 mcraft = 15e3 deltat = 60 fscale=1000 pscale=0.1 mmoon=0 #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=5e5, color=color.yellow) moon = sphere(pos=vector(4e8,0,0), radius=1.75e6, color=color.white) vcraft = vector(0,3.27e3,0) pcraft = mcraft*vcraft parr=arrow(color=color.green) farr=arrow(color=color.red) 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 Kgraph = gcurve(color=color.yellow) ## create a gcurve for kinetic energy Ugraph = gcurve(color=color.red) ## create a gcurve for potential energy
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/28/2012 for the course PY 205M taught by Professor Brown during the Spring '08 term at N.C. State.

Page1 / 2

Lab 07 - SpaceVoyage3 - from _future_ import division from...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online