dipolelab - from __future__ import division from visual...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: from __future__ import division from visual import * f #constants scale_factor = 3e-21 oofpez = 9e9 echarge = 1.6e-19 e #objects plus = sphere(pos=vector(-5e-11,0,0), radius=1e-11, color=color.red) minus = sphere(pos=vector(5e-11,0,0), radius=1e-11, color=color.blue) m #initial values obslocation = vector(2e-10,0,0) theta = 0 t #calculations # while theta < 2*pi: unit = vector(cos(theta), sin(theta), 0) rmag = 2e-10 obslocation = rmag*unit rplus = obslocation - plus.pos Eplus = (oofpez*echarge/(mag(rplus)**2))*(rplus/mag(rplus)) rminus = obslocation - minus.pos Eminus = (oofpez*-echarge/(mag(rminus)**2))*(rminus/mag(rminus)) Enet = Eplus + Eminus print "Enet = ",Enet print "Location = ", obslocation arrow(pos=obslocation, axis=Enet*scale_factor, color=color.orange) theta = theta + pi/6 theta = 0 while theta < 2*pi: unit = vector(sin(theta), 0, cos(theta)) rmag = 2e-10 obslocation = rmag*unit rplus = obslocation - plus.pos Eplus = (oofpez*echarge/(mag(rplus)**2))*(rplus/mag(rplus)) rminus = obslocation - minus.posrminus = obslocation - minus....
View Full Document

This note was uploaded on 09/12/2011 for the course PHYISCS 2212 taught by Professor Shatz during the Spring '10 term at Georgia Tech.

Page1 / 2

dipolelab - from __future__ import division from visual...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online