Rename this notebook so that it includes your name. Quick refresher (last one on this topic!): Click the name of the lab at the top to rename it.
How to edit text or computer code: double click on it to edit, push Shift-Enter when you are done.
Your simulations in this class are a tool to model the physical world. You will do that using a package called "ivisual".
The code in the cell below will create an animation of a box. Until you make modifications later in this lab it will be a pretty boring animation...nothing will move!
However, you can interact with the animation:
Execute the code cell below and trying rotation and zooming.
In [ ]:
from ivisual import *
In [ ]:
scene = canvas()
scene.autoscale = False
initial_box_pos = vector(0, 0, 0) # meters
my_box = box(size=(1, 2, 3))
my_box.pos = initial_box_pos
finished = False
velocity = vector(0, 0, 0) # m/s
dt = 0.1 # sec
steps = 0
while not finished:
rate(30) # no more than 50 frames per second
my_box.pos = my_box.pos + velocity * dt
steps = steps + 1
if my_box.pos.x > 10 or steps > 100:
finished = True