HOME

TheInfoList



OR:

VPython is the
Python programming language Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Python is dynamically-typed and garbage-collected. It supports multiple programming par ...
plus a 3D graphics module called Visual. VPython allows users to create objects such as spheres and cones in 3D space and displays these objects in a window. This makes it easy to create simple visualizations, allowing programmers 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.


History

In 1985, the cT programming language was created by researchers at
Carnegie Mellon University Carnegie Mellon University (CMU) is a private research university in Pittsburgh, Pennsylvania. One of its predecessors was established in 1900 by Andrew Carnegie as the Carnegie Technical Schools; it became the Carnegie Institute of Technology ...
. Contributors 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. Many prize-winning educational programs were written in cT (see
VISQ VISQ (Portuguese acronym for "Variables that Interact Semi-Quantitatively") is a scientific-educational software developed using Carnegie-Mellon's cT, in the year of 1993 by M. Thielo (as a physics undergrad at the time), based on Jon Ogborn ideas ...
), especially in the area of physics. In 1997, students at Carnegie Mellon were taught cT in a new introductory physic
course
created by
Ruth Chabay Ruth Wright Chabay (born 1949) is an American physics educator known for her work in educational technology and as the coauthor of the calculus-based physics textbook ''Matter and Interactions''. She is professor emerita of physics at North Caro ...
and Bruce Sherwood. In 1998, David Scherer entered the university as a freshman and enrolled in one of the introductory physics classes that used cT. Although cT offered a relatively easy 2D graphics programming environment, Scherer saw the possibility of creating an even better tool. In the spring and summer of 2000, with the assistance of David Andersen, Ruth Chabay, Ari Heitner, Ian Peters, and Bruce Sherwood, Scherer 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. The combination of Python plus Visual is called VPython. Further development of the cT programming language was ended and the newly created VPython was used in its place. Since VPython's creation, several versions have been released to the public. In 2016, developers announced that classic VPython would no longer be developed. Instead, development will concentrate o
Glowscript
and Jupyter implementations of the language.


Usage

VPython is a simple rendering tool for 3D objects and graphs. Its main use has been in education, but it has also been used in commercial or research settings. VPython was first used in introductory physics courses at Carnegie Mellon and then spread to other universities and eventually high schools, especially in connection with th
Matter & Interactions curriculum
A related development due to David Scherer and Bruce Sherwood i
GlowScript
which makes it possible to write and run VPython programs in a browser, including on mobile devices, thanks to th
RapydScript
Python-to-JavaScript compiler, created by Alexander Tsepkov. Programs can be written, run, and stored at glowscript.org, and the compiled-to-JavaScript code can be exported and embedded in one's own web page. John Coady has created th
ivisual
version for use in th
IPython, now Jupyter
environment, using the GlowScript WebGL graphics libraries to render 3D output in an IPython/Jupyter notebook. Rhett Allain in hi
Wired blog
shows an example of usin
Trinkets
to embed both editable VPython source code and 3D execution in one's own web page.


Objects

See the article on Python for Python syntax. This article will address several of the objects that are VPython specific. Clic
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 (in older VPython implementations, the module to import is ''vpython'', not ''visual''): from visual import * # Import the visual module rod = cylinder(pos=(0, 2, 1), axis=(5, 0, 0), radius=1) Some similar objects offered by the VPython 3D rendering engine are th

an

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 from numpy import arange, cos, exp 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


References


External links

*http://www.vpython.org/ *http://www.vpython.org/contents/cTsource/cToverview.html *http://linuxgazette.net/144/john.html *{{cite journal, last1=Scherer, first1=D., last2=Dubois, first2=P., last3=Sherwood, first3=B., name-list-style=amp, year=2000, title=VPython: 3D Interactive Scientific Graphics for Students, journal=Computing in Science and Engineering, volume=2, issue=Sept./Oct. 2000, pages=82–88, bibcode=2000CSE.....2e..56S, doi=10.1109/5992.877397 Articles with example Python (programming language) code Python (programming language) libraries