VPython

From Wikipedia, the free encyclopedia

Visual (Python Mod)
Paradigm: Multi-paradigm
Appeared in: 2000
Designed by: David Scherer
Developer: Open-Source
Latest release: 4.beta5 / August 10, 2006
Typing discipline: Strong, dynamic ("duck")
Major implementations: cPython
Influenced by: Python
OS: Cross-platform
License: Open-Source
Website: www.vpython.org

VPython was created in 1999 as the result of an independent project undertaken by David Scherer, a sophomore at Carnegie Mellon University. Vpython is 3D graphics engine for the python programming language. It allows users to create objects (such as spheres and cones) and graphs (such as histograms and line graphs) in 3D space and displays these objects in a window. The major advantage of vpython is that it allows python users to create simple visualizations easily, allowing them to focus more on the computational aspect of their programs. The simplicity of vpython has made it a tool for the illustration of simple physics, especially in the educational environment.

Contents

[edit] History

In 1985, the cT programming language was created by researchers at Carnegie Mellon University in Pittsburgh. Contributers to the project included David Andersen, Bruce Sherwood, Judith Sherwood, and Kevin Whitley. The cT programming language was largely spawned from the TUTOR (1965) and the MicroTutor (1977) programming languages. Although cT had many applications, its primary usage was 2D graphics for the classroom setting. It was especially well suited for physics. In 1997, students at Carnegie Mellon were taught cT in introductory physics classes. In 1998, David Scherer entered the university as a freshman and enrolled in one of the introductory physics classes that used cT. Unfortunately cT was a difficult language to develop and was inconvenient for the students. Scherer recognized this problem and proposed the development of a similar tool for the python programming language. The goal was to make this tool more user-friendly than the cT programming language. By 1999 with the assistance of David Andersen, Ruth Chabay, Ari Heitner, Ian Peters, and Bruce Sherwood, Scherer had created Visual, a module for python that was not only easier to use than the cT programming language, but also rendered objects in Three Dimensions. In 2000, development on the cT programming language came to a halt and the newly created vpython was used in its place. Since vPython's creation, several versions have been released to the public. The current version in development is 4.beta5. Some of the major developments in this release include textures and transparency. More details on features currently in development may be seen here.

[edit] Usage

VPython is a simple rendering tool for graphs and 3D objects and has not been used extensively in commercial or research settings. The language was primarily created for the classroom. VPython was first used in introductory physics courses at Carnegie Mellon and then spread to other universities and eventually high schools. In 2006, a textbook named Matter and Interactions was created that integrated vpython into its curriculum. In the future it is likely that vpython will become more frequently used in physics classrooms throughout the nation.

[edit] Objects

See the article on Python for python syntax. This article will address several of the objects that are vpython specific. Click here for the complete documentation. The cylinder object is a good example of a simple vPython object. Here is an example of a simple cylinder as given in vPython's documentation:

   from visual import * #import the visual module
   rod = cylinder(pos=(0,2,1), axis=(5,0,0), radius=1)

Image:VisualRef-1.gif

Some similar objects offered by the vPython 3D rendering engine are the cone, sphere, and box objects. In addition to solid objects, vPython offers graphing tools as well. Here is an example of a simple graph in vPython as given in its documentation:

   from visual.graph import * # import graphing features
 
   funct1 = gcurve(color=color.cyan) # a connected curve object
 
   for x in arange(0., 8.1, 0.1): # x goes from 0 to 8
       funct1.plot(pos=(x,5.*cos(2.*x)*exp(-0.2*x))) # plot

Image:VPython_graph.gif

[edit] References