You are on page 1of 2

Jenna Cooper

Honors Physics
Block

Lab 1: Introduction to VPython

The pos attribute describes the position of an arrow in three-dimensional space. Note:
They are at the end of the object.

The axis attribute describes the axis that the arrow will run along (x,y,z), say up/down
by x, left/right by y, and backwards/forwards by z.

The position of the first sphere so that it appears at the tip of the red arrow is (5,1,0)
The position of the second sphere so that it appears at the tip of the cyan arrow is (6,6,0)
#Jenna Cooper
#Lab1 due:
from visual import *

baseball = sphere(pos=vec(5,1,0), radius=0.20, color=color.white)


tennisball = sphere(pos=vec(6,6,0),radius=0.15, color=color.green)

#arrow(pos=vec(2,-3,0), axis=vec(3,4, 0), color=color.cyan)


Raymond = arrow(pos=baseball.pos, axis=(tennisball.pos-baseball.pos),
color=color.red, shaftwidth=0.1)

print(tennisball.pos.y)

You might also like