spacevoyage1.py - GlowScript 2.4 VPython from_future import...

This preview shows page 1 - 2 out of 2 pages.

GlowScript 2.4 VPython from __future__ import division from visual import * scene.width=1024 scene.height=760 # CONSTANTS G = 6.7e-11 mEarth = 6e24 mcraft = 15e3 deltat = 60 t = 0 pscale=5e-1 fscale=1e4 dpscale=1e4 #OBJECTS AND INITIAL VALUES Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan) scene.range=11*Earth.radius # Add a radius for the spacecraft. It should be BIG, so it can be seen. craft = sphere(pos=vector(-6.848e+07,6.4e+04,0),radius=1e6, color=color.yellow) vcraft = vector(767,2722,0) pcraft = mcraft*vcraft parrow=arrow(color=color.green) farrow = arrow(color=color.cyan) dparrow = arrow(color=color.red) trail = curve(color=craft.color) # This creates a trail for the spacecraft scene.autoscale = 0 # And this prevents zooming in or out # CALCULATIONS while t < 1103760: rate(50000) # This slows down the animation (runs faster with bigger
Image of page 1

Subscribe to view the full document.

Image of page 2
You've reached the end of this preview.
  • Spring '08
  • UZER
  • ZOOM, pcraft

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern