lab4crafts - r3 = craft3.pos - planet.pos rmag3= mag(r3)...

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 * f G = 6.7e-11 mcraft = 15e3 mplanet = 6e24 Fscale = 1e5 F planet = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.blue) craft = sphere(pos=vector(-13e7, 6.5e7, 0), radius=3e6, color=color.magenta) c r = craft.pos - planet.pos rmag = mag(r) Fmag = (G*mcraft*mplanet)/rmag**2 rhat = r/rmag Fnet = -Fmag*rhat print "Fnet =", Fnet p arr = arrow(pos=craft.pos, axis=Fnet*Fscale, color=color.yellow) a craft2 = sphere(pos=vector(-6.5e7, 6.5e7, 0), radius=3e6, color=color.cyan) r2 = craft2.pos - planet.pos rmag2 = mag(r2) Fmag2 = (G*mcraft*mplanet)/rmag2**2 rhat2 = r2/rmag2 Fnet2 = -Fmag2*rhat2 arr2 = arrow(pos=craft2.pos, axis=Fnet2*Fscale, color=color.yellow) a craft3 = sphere(pos=vector(0, 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: r3 = craft3.pos - planet.pos rmag3= mag(r3) Fmag3 = (G*mcraft*mplanet)/rmag3**2 rhat3 = r3/rmag3 Fnet3 = -Fmag3*rhat3 arr3 = arrow(pos=craft3.pos, axis=Fnet3*Fscale, color=color.yellow) a craft4 = sphere(pos=vector(6.5e7, 6.5e7, 0), radius=3e6, color=color.green) r4 = craft4.pos - planet.pos rmag4= mag(r4) Fmag4 = (G*mcraft*mplanet)/rmag4**2 rhat4 = r4/rmag4 Fnet4 = -Fmag4*rhat4 arr4 = arrow(pos=craft4.pos, axis=Fnet4*Fscale, color=color.yellow) a craft5 = sphere(pos=vector(13e7, 6.5e7, 0), radius=3e6, color=color.red) r5 = craft5.pos - planet.pos rmag5= mag(r5) Fmag5 = (G*mcraft*mplanet)/rmag5**2 rhat5 = r5/rmag5 Fnet5 = -Fmag5*rhat5 arr5 = arrow(pos=craft5.pos, axis=Fnet5*Fscale, color=color.yellow)...
View Full Document

Ask a homework question - tutors are online