From: Joe H. <hea...@ct...> - 2005-02-17 20:07:48
|
I'm running VPython 3.0 with Python 2.3.4 under Mac OS X 10.3.x. I just noticed that this version of VPython uses angle brackets when printing out the components of vectors, e.g. <1,2,3>. Previous versions used square brackets. Since the M&I textbook uses angle brackets, I was wondering whether it would be possible, or even worthwhile, to change the VPython syntax to use angle brackets to define the numerical components of vectors. For example, instead of writing cart.pos = vector(2,0,0) we could write cart.pos = <2,0,0> or instead of writing Earth = sphere(pos=vector(1e11,0,0)) we could write Earth = sphere(pos=<1e11,0,0>). Basically any time the components of a vector quantity are given as a triplet of numbers the angle brackets could be used. Pedagogically, I think this would make VPython syntax "look" more like the notation in the textbook. While the "vector" preceding the components in the pos attribute above is optional, I tell my students to include it. I think using angle brackets would reduce the list of things to remember by one and still immediately draw attention to vectors in VPython code. Cheers, Joe Heafner -- Astronomy/Physics Instructor (by some definitions) |