Lab 04 - VPython

Lab 04 - VPython - craft3 = sphere(pos = vector(0, 6.5e7,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
from __future__ import division from visual import * G = 6.7e-11 mcraft = 15e3 mplanet = 6e24 planet = sphere(pos = vector(0, 0, 0), radius = 6.4e6, color = color.red) craft = sphere(pos = vector(-13e7, 6.5e7, 0), radius = 3e6, color = color.green) r = craft.pos - planet.pos rmag = sqrt(r.x**2 + r.y**2 + r.z**2) Fmag = (G * mcraft * mplanet) / rmag rhat = r / rmag Fnet = -Fmag * rhat print "Fnet =", Fnet Fscale = (planet.pos - craft.pos) / Fmag arr2 = arrow(pos=craft.pos, axis=(planet.pos - craft.pos)/3, color=color.yellow) craft2 = sphere(pos = vector(-6.5e7, 6.5e7, 0), radius = 3e6, color = color.green)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: craft3 = sphere(pos = vector(0, 6.5e7, 0), radius = 3e6, color = color.green) craft4 = sphere(pos = vector(6.5e7, 6.5e7, 0), radius = 3e6, color = color.green) craft5 = sphere(pos = vector(13e7, 6.5e7, 0), radius = 3e6, color = color.green) arr3 = arrow(pos=craft2.pos, axis=(planet.pos - craft2.pos)/3, color=color.yellow) arr4 = arrow(pos=craft3.pos, axis=(planet.pos - craft3.pos)/3, color=color.yellow) arr5 = arrow(pos=craft4.pos, axis=(planet.pos - craft4.pos)/3, color=color.yellow) arr6 = arrow(pos=craft5.pos, axis=(planet.pos - craft5.pos)/3, color=color.yellow)...
View Full Document

This note was uploaded on 01/28/2012 for the course PY 205M taught by Professor Brown during the Spring '08 term at N.C. State.

Ask a homework question - tutors are online