programshell.py - 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
Sheet1 Page 1 from __future__ import division from visual import * scene.range = 20 scene.width = 1024 scene.height = 800 scene.background = (0.95,0.95,0.95) def sphereGenerator(n,list_of_locations): ballcount=0 while ballcount<n: m = scene.mouse.getclick() loc = m.pos ball=sphere(pos=loc, radius=0.75, color=color.blue) label(pos=loc, text='%1.0f' % ballcount) list_of_locations.append(ball.pos) ballcount=ballcount+1 return list_of_locations ## arrowGenerator produces an arrow whose tail is located at ## arrowPosition with axis arrowAxis. The color of the arrow ## is set by arrowColor def arrowGenerator(arrowPosition,arrowAxis,arrowColor): arrow(pos=arrowPosition,axis=arrowAxis,color=arrowColor) def drawTrajectory(n,list_of_locations,list_of_avgmomenta,pscale): scene2 = display(x=0, y=0, width=1024, height=800, range=20, background=(0.95,0.95,0.95)) trail=curve(color=color.blue) i=0 while i<n: rate(2) sphere(pos=list_of_locations[i],radius=0.75,color=color.blue) label(pos=list_of_locations[i], text='%1.0f' % i)
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 2211 taught by Professor Jarrio during the Spring '10 term at Georgia Institute of Technology.

Page1 / 3

programshell.py - 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