Question: PYTHON: Create a program that will model the motion of a spacecraft traveling from the Earth to the Moon (using VIDLE PYTHON 2.7) Shell of

PYTHON: Create a program that will model the motion of a spacecraft traveling from the Earth to the Moon (using VIDLE PYTHON 2.7)

Shell of program

from __future__ import division from visual import * scene.width =1024 scene.height = 760

#CONSTANTS G = 6.7e-11 mEarth = 6e24 mcraft = 15e3 deltat = 60

#OBJECTS AND INITIAL VALUES Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan) craft = sphere(pos=vector(-10*Earth.radius, 0,0), color=color.yellow, make_trail=True) vcraft = vector(0,0,0)

t = 0 scene.autoscale = 0 ## do not allow camera to zoom in or out

#CALCULATIONS

while t < 10*365*24*60*60: rate(200) ## slow down motion to make animation look nicer ## you must add statements for the iterative update of ## gravitational force, velocity, and position

## check to see if the spacecraft has crashed on the Earth. ## if so, get out of the calculation loop t = t+deltat

print 'Calculations finished after ',t,'seconds'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!