vectors - # # xvec = arrow(pos=baseball.pos,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
from __future__ import division from visual import * f=open('Position Data.txt','r') f posx = float(f.read(4)) blank1 = f.read(1) posy = float(f.read(4)) blank2 = f.read(1) posz = float(f.read(4)) blank2 = f.read(1) location = vector(posx,posy,posz) l print location p # baseball = sphere(pos=vector(-5,2,-3), radius=0.40, color=color.red) # tennisball = sphere(pos=vector(-3,-1,0), radius=0.15, color=color.green) # bt = arrow(pos=baseball.pos, axis=tennisball.pos-baseball.pos, color=color.cyan)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: # # xvec = arrow(pos=baseball.pos, axis=vector(bt.axis.x,0,0), color=color.yellow) # yvec = arrow(pos=baseball.pos, axis=vector(0,bt.axis.y,0), color=color.yellow) # zvec = arrow(pos=baseball.pos, axis=vector(0,0,bt.axis.z), color=color.yellow) # # print tennisball.pos # print tennisball.pos - baseball.pos...
View Full Document

This note was uploaded on 06/19/2010 for the course PHYSICS Physics taught by Professor Greco during the Spring '10 term at Georgia Institute of Technology.

Ask a homework question - tutors are online