# lab03.py - from_future import division from visual...

• Lab Report
• 2

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

from __future__ import division from visual import * #constants k = 9e9 e = 1.6e-19 scale = 4e-21 r = 2e-10 #objects sphereN = sphere(pos=vector(-5e-11,0,0), radius=1e-11, color=color.blue) sphereP = sphere(pos=vector(5e-11,0,0), radius=1e-11, color=color.red) #Initial Values obslocation = vector(2e-10,0,0) #Calculations E=(k*e/(mag2(obslocation-sphereP.pos)))*(norm(obslocation-sphereP.pos))+(k*-1*e/ (mag2(obslocation-sphereN.pos)))*(norm(obslocation-sphereN.pos)) print(E) arrow(pos=obslocation, axis=E*scale, color=color.orange) theta = pi/6 while theta < 2*pi: obslocation = vector(2e-10*cos(theta),2e-10*sin(theta),0) E=(k*e/(mag2(obslocation-sphereP.pos)))*(norm(obslocation-sphereP.pos))+(k*- 1*e/(mag2(obslocation-sphereN.pos)))*(norm(obslocation-sphereN.pos)) print(E) arrow(pos=obslocation, axis=E*scale, color=color.orange) theta = theta + pi/6 theta = 0 while theta < 2*pi: obslocation = vector(2e-10*cos(theta),0, 2e-10*sin(theta)) E=(k*e/(mag2(obslocation-sphereP.pos)))*(norm(obslocation-sphereP.pos))+(k*- 1*e/(mag2(obslocation-sphereN.pos)))*(norm(obslocation-sphereN.pos)) print(E) arrow(pos=obslocation, axis=E*scale, color=color.orange)

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

This is the end of the preview. Sign up to access the rest of the document.
• Spring '09
• Kindermann
• Physics, (obslocation-sphereN.pos))

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern