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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started