Member-only story
Python Physics: Motion in 3D and Animations
Continuing my series on python for introductory physics. In this chapter, we are going to go over the stuff that makes Web VPython so awesome — 3D motion and animations.
If you are keeping up, here are the previous chapters:
OK, let’s get to it.
Vectors
I know what you are going to say, “a vector has magnitude and direction”. I mean, that’s not wrong — but that’s not the version I like. Here’s how I describe vectors. My preferred definition is that a vector is a variable with more than one number. Three dimensional vectors have three numbers. In Cartesian coordinates, we can describe a position as the following vector (I will write it three different ways).
These are all the same things, but I prefer the last version.
If we want to animate objects in 3D, we obviously need three dimensional vectors. Good news! Vectors are built into VPython. Here’s some quick vector stuff in VPython.









