# Function for calculating the percent of fuel remaining, as text def FuelPct(self): return "Fuel Supply: {0:.1f}%".format(100 * self.FuelLeft / mdescfuel) # Function for showing the vertical velocity def VertVel(self): if not self.ElapsedTime: return "Vertical Velocity N/A" else: return "Vertical Velocity: {0:.1f} m/s".format(self.DeltaAltitude / self.ElapsedTime) moon = Planet(planetmass=moonmass, radius=moonradius, viewscale=0.02, color=0x202020) tz = Slider((10, 300), 0, 5, 0, positioning="physical", leftkey="a", rightkey="d") #Create and "run" the rocket lander = Lem(moon, altitude=alt, velocity=vel, timescale=tz) moon.run(lander)
from ggrocket import Rocket, Planet earth = Planet(viewscale=0.00014, planetmass=73420000000000000000000) rocket = Rocket(earth, altitude=100, velocity=1000, timezoom=3) earth.run(rocket)
from ggrocket import Rocket, Planet moon = Planet(viewscale=0.00005, planetmass=7.348E22, radius=1737000) rocket = Rocket(moon, altitude=1837000, velocity=1000, timezoom=3) moon.run(rocket)