コード例 #1
0
from ggrocket import Rocket, Planet

earth = Planet(viewscale=0.00005)
rocket = Rocket(earth, altitude=400000, velocity=7670, timezoom=2)
earth.run(rocket)

コード例 #2
0
from ggrocket import Rocket, Planet

earth = Planet(viewscale=0.00002)
rocket = Rocket(earth, altitude=408365, velocity=7645, timezoom=3)
earth.run(rocket)
コード例 #3
0
            return 0
        else:
            return Ftotal
    else:
        return 0


def StartRocket():
    global RocketStarted
    global StartTime
    if not RocketStarted:
        RocketStarted = True
        StartTime = rocket.shiptime


def GetMass():
    global RocketStarted
    if RocketStarted:
        return Me + Mp * (Tburn - BurnTime) / Tburn
    else:
        return Me + Mp


start = InputButton((10, 400),
                    "START",
                    StartRocket,
                    positioning="physical",
                    size=15)

rocket = Rocket(earth, thrust=GetThrust, mass=GetMass, heading=radians(90))
earth.run(rocket)
コード例 #4
0
ファイル: rocket1.py プロジェクト: samkrimmel/Rocket-Science
#Sam Krimmel
#3/14/18
#rocket1.py - first rocket program

from ggrocket import Rocket, Planet

earth = Planet(color=(0x9aa2af),
               radius=1737400,
               planetmass=73480000000000000000000,
               viewscale=0.00002)
rocket = Rocket(earth, altitude=100000, velocity=1632, timezoom=3, thrust=1)
earth.run(rocket)
コード例 #5
0
ファイル: rocket4.py プロジェクト: NotGithubDad/rocketscience
        # not even started: just return the full pre-launch rocket mass
        return me1 + mp1 + me2 + mp2 + mep

# Function for displaying the rocket status
def GetStatus():
    global Stage1Started
    global Stage2Started
    global PayloadLaunched
    if Stage1Started:
        return "STAGE 1 FIRING"
    elif Stage2Started:
        return "STAGE 2 FIRING"
    elif PayloadLaunched:
        return "PAYLOAD DELIVERED"
    else:
        return "WAITING FOR LAUNCH"

# Create a button for starting the simulation
# Physical positioning at 10,400 pixels, calls the StartRocket function
start = InputButton((10,400), "START", StartRocket, positioning="physical", size=15)

# Create a label for showing the current rocket status
status = Label((10,420), GetStatus, positioning="physical", size=15)

# Add a slider for conrolling the timezoom
tz = Slider((10,360), 0, 5, 0, positioning="physical")

#Create and "run" the rocket
rocket = Rocket(earth, thrust=GetThrust, mass=GetMass, timezoom=tz)
earth.run(rocket)
コード例 #6
0
        # calculate empty mass plus a fraction of the propellent mass based on time
        return me + mp * (tburn - BurnTime) / tburn
    else:
        # not started: just return the full pre-launch rocket mass
        return me + mp


def GetHeading():
    global BurnTime
    return radians(90 - (83.5 * (BurnTime / 180)))


# Create a button for starting the simulation
# Physical positioning at 10,400 pixels, calls the StartRocket function
start = InputButton((10, 400),
                    "START",
                    StartRocket,
                    positioning="physical",
                    size=15)

# Add a slider for controlling the timezoom
tz = Slider((10, 500), 0, 5, 0, positioning="physical")

#Create and "run" the rocket
rocket = Rocket(earth,
                thrust=GetThrust,
                mass=GetMass,
                heading=GetHeading,
                timezoom=tz)
earth.run(rocket)
コード例 #7
0
ファイル: rocket1.py プロジェクト: brianglenney/rocketscience
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)
コード例 #8
0
#rocket1
from ggrocket import Rocket, Planet

earth = Planet()
rocket = Rocket(earth)
earth.run(rocket)
コード例 #9
0
from ggrocket import Rocket, Planet

earth = Planet(viewscale=0.00005)
rocket = Rocket(earth, altitude=4000000, velocity=7904.50720939, timezoom=1)
earth.run(rocket)
コード例 #10
0
from ggrocket import Rocket, Planet
from ggame import *

data = {}
data['thrust'] = 0


def thrust():
    return data['thrust']


earth = Planet(color=(0x9aa2af),
               radius=1737400,
               planetmass=73480000000000000000000,
               viewscale=0.00002)
rocket = Rocket(earth, altitude=0, velocity=0, timezoom=0.5, thrust=thrust)


def upThrust(event):
    data['thrust'] += 0.2


def downThrust(event):
    data['thrust'] -= 0.2


App.listenKeyEvent('keydown', 'w', upThrust)
App.listenKeyEvent('keydown', 's', downThrust)

earth.run(rocket)
コード例 #11
0
ファイル: rocket1.py プロジェクト: NotGithubDad/rocketscience
# rocketscience
from ggrocket import Rocket, Planet

earth = Planet(viewscale=0.00005)
rocket = Rocket(earth, altitude=400000, velocity=7725.73, timezoom=1)
earth.run(rocket)
コード例 #12
0
from ggrocket import Rocket, Planet

earth = Planet(viewscale=.001082)
rocket = Rocket(earth, altitude=161000, velocity=7810, timezoom=3.6)
earth.run(rocket)
コード例 #13
0
from ggrocket import Rocket, Planet

earth = Planet(viewscale=5)
rocket = Rocket(earth, altitude=50)
earth.run(rocket)

コード例 #14
0
#James Roth
#3/14/18
#safeAltitudes.py - safe velocity for low earth orbits

from ggrocket import Rocket, Planet

earth = Planet(viewscale=0.00005)
rocket = Rocket(earth, altitude=200000, velocity=7900, timezoom=0.1)
earth.run(rocket)
コード例 #15
0
ファイル: rocket2.py プロジェクト: LordBOSS42/rocketscience
from ggrocket import Rocket, Planet 
from math import radians, sqrt

earth = Planet(viewscale=0.00005)

Re = 6.371E6
Me = 5.972E24
G = 6.674E-11

Ve=sqrt (2*Me*G/Re)
print ("Predicted escape velocity is ", Ve, " m/s")

rocket = Rocket(earth, heading=radians(90), directiond=90, velocity=Ve)

earth.run (rocket)
コード例 #16
0
ファイル: rocket3.py プロジェクト: glenpassow/rocketscience
        else:
            return Ftotal
    else:
        return 0


def StartRocket():
    global RocketStarted
    global StartTime
    if not RocketStarted:
        RocketStarted = True
        StartTime = rocket.shiptime


def GetMass():
    global RocketStarted
    if RocketStarted:
        return me + mp * (tburn - BurnTime) / tburn
    else:
        return me + mp


start = InputButton((10, 400),
                    "START",
                    StartRocket,
                    positioning="physical",
                    size=15)

rocket = Rocket(earth, thrust=GetThrust, mass=GetMass)
earth.run(rocket)
コード例 #17
0
from ggrocket import Rocket, Planet

earth = Planet(viewscale=0.00014, planetmass=73420000000000000000000)
rocket = Rocket(earth, altitude=100, velocity=1000, timezoom=3)
earth.run(rocket)
コード例 #18
0
from ggrocket import Rocket, Planet

earth = Planet(viewscale=0.000005, color=0x800080)
rocket = Rocket(earth, altitude=2000000, velocity=6900.39, timezoom=3)
earth.run(rocket)