lab4 - from _future_ import division from visual import *...

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

View Full Document Right Arrow Icon
from __future__ import division from visual import * scene.width = 1024 scene.height = 768 scene.x = scene.y = 0 s # constants oofpez = 9e9 L = 2.9 Q = 65e-9 N = 15 scalefactor = .1 dz = L/N dQ = Q/N R = .5 a = .44 a # list of charges list_of_charges = [] z = -L/2 + dz/2 while z < L/2: list_of_charges.append(sphere(pos=(0,0,z), radius=.1, color=color.green)) z = z+dz print len(list_of_charges) ## print number of items in list p ## uncomment these two lines to make program wait for a mouse click: print 'Click anywhere to continue' scene.mouse.getclick() ## wait for a mouse click, then continue s # list of arrows; tail of each arrow is at an observation location dzz = ((10/8)*L)/10 list_of_arrows = [] for z in arange(-5*L/8, 5*L/8+.001, dzz): for theta in arange(0,2*pi, pi/4): list_of_arrows.append(arrow(pos=(R*cos(theta), R*sin(theta),z), axis=(0,1,0))) ## uncomment these two lines to make program wait for a mouse click: print 'Click anywhere to continue' scene.mouse.getclick() ## wait for a mouse click, then continue
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the 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

lab4 - from _future_ import division from visual import *...

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