from __future__ import division
from visual import *
from visual.graph import *
from physutil import *

#Window Setup
scene.width = 750
scene.height = 500
scene.range = .5e-4

#Objects
Paulino = sphere(pos=vector(0,0,0), radius=2e-6, color=color.red)
Dannyon = sphere(pos=vector(20e-6,0,0), radius=1e-6, color=color.green, make_trail=True)

#Initial Conditions and Values
mPaulino = 50e-23

mDannyon = 1e-23
vDannyon = vector(0,500,0)
pDannyon = mDannyon * vDannyon

G = 6.67e-11
k = 10e-7
L0 = 15e-6

#Time Setup
dt = 1e-9
t = 0
tf = 1.5e-7

#Calculation Loop
while t < tf:
	rate(100)

	Fgrav = -G*mDannyon*mPaulino  *  (Dannyon.pos)/mag(Dannyon.pos)  /  mag(Dannyon.pos)**2
	Fnet = Fgrav

	pDannyon = pDannyon + Fnet*dt
	Dannyon.pos = Dannyon.pos + pDannyon/mDannyon*dt
	t = t + dt
