VPython: Difference between revisions

From Physics Book
Jump to navigation Jump to search
(Added 'claimed by' banner)
(Updated images)
Line 3: Line 3:
VPython is a Python graphics module used for modeling objects in 3-dimensional space.  In the field of physics, this is especially useful for calculating and modeling complex relationships between objects and their properties.
VPython is a Python graphics module used for modeling objects in 3-dimensional space.  In the field of physics, this is especially useful for calculating and modeling complex relationships between objects and their properties.


[[File:VPythonMagneticForce.png|300px]]
[[File:VPythonMagneticForce.png|thumb|VPython modeling the magnetic force on a moving particle]]


==Installation==
==Installation==
Line 10: Line 10:


===Windows===
===Windows===
[[File:VPythonWindows.png|thumb|VPython running in Windows 7]]
1. Install [http://python.org/ftp/python/2.7.9/python-2.7.9.amd64.msi Python-2.7].
1. Install [http://python.org/ftp/python/2.7.9/python-2.7.9.amd64.msi Python-2.7].


2. Download and install VPython from [http://sourceforge.net/projects/vpythonwx/files/6.11-release/VPython-Win-64-Py2.7-6.11.exe/download Sourceforge].
2. Download and install VPython from [http://sourceforge.net/projects/vpythonwx/files/6.11-release/VPython-Win-64-Py2.7-6.11.exe/download Sourceforge].
[[File:VPythonWindows.png|400px]]


To troubleshoot any installation issues, look at the extensive [http://vpython.org/contents/download_windows.html VPython Windows installation guide].
To troubleshoot any installation issues, look at the extensive [http://vpython.org/contents/download_windows.html VPython Windows installation guide].


===OSX===
===OSX===
[[File:VPythonOSX.png|thumb|VPython running in OSX 10.10]]


1. Install [https://www.python.org/ftp/python/2.7.9/python-2.7.9-macosx10.6.pkg Python-2.7].  This is required as the version of Python that Apple provides is not compatible.
1. Install [https://www.python.org/ftp/python/2.7.9/python-2.7.9-macosx10.6.pkg Python-2.7].  This is required as the version of Python that Apple provides is not compatible.
Line 24: Line 25:
2. Download and install the VPython package from [http://sourceforge.net/projects/vpythonwx/files/6.11-release/VPython-Mac-Py2.7-6.11.dmg/download Sourceforge].
2. Download and install the VPython package from [http://sourceforge.net/projects/vpythonwx/files/6.11-release/VPython-Mac-Py2.7-6.11.dmg/download Sourceforge].


[[File:VPythonOSX.png|400px]]


To troubleshoot installation issues, see the extensive [http://vpython.org/contents/download_mac.html VPython Mac installation guide].
To troubleshoot installation issues, see the extensive [http://vpython.org/contents/download_mac.html VPython Mac installation guide].


===Linux===
===GNU/Linux===
[[File:VPythonUbuntu.png|thumb|VPython running in Ubuntu 15.04]]


Some Linux distributions include VPython in their repositories.  For example, to install VPython in Ubuntu 15.04:
Some Linux distributions include VPython in their repositories.  For example, to install VPython in Ubuntu 15.04:
Line 34: Line 35:
<code>sudo apt-get install python-visual</code>
<code>sudo apt-get install python-visual</code>


[[File:VPythonUbuntu.png|400px]]


If your Linux distribution's repository does not have the latest version of VPython, you can run the Windows version using [https://www.winehq.org/ Wine].  The [http://vpython.org/contents/download_linux.html VPython Linux installation guide] contains instructions.
If your Linux distribution's repository does not have the latest version of VPython, you can run the Windows version using [https://www.winehq.org/ Wine].  The [http://vpython.org/contents/download_linux.html VPython Linux installation guide] contains detailed instructions.


==Getting started with Python==
==Getting started with Python==

Revision as of 00:38, 3 December 2015

Claimed by Nathan Cheek

VPython is a Python graphics module used for modeling objects in 3-dimensional space. In the field of physics, this is especially useful for calculating and modeling complex relationships between objects and their properties.

VPython modeling the magnetic force on a moving particle

Installation

VPython is compatible with Windows, OSX, and Linux. While there is an older VPython version available that supports Python 3, the Georgia Tech physics courses use Python 2 syntax so it is recommended to install the latest version of VPython as outlined below.

Windows

Error creating thumbnail: sh: /usr/bin/convert: No such file or directory Error code: 127
VPython running in Windows 7

1. Install Python-2.7.

2. Download and install VPython from Sourceforge.

To troubleshoot any installation issues, look at the extensive VPython Windows installation guide.

OSX

Error creating thumbnail: sh: /usr/bin/convert: No such file or directory Error code: 127
VPython running in OSX 10.10

1. Install Python-2.7. This is required as the version of Python that Apple provides is not compatible.

2. Download and install the VPython package from Sourceforge.


To troubleshoot installation issues, see the extensive VPython Mac installation guide.

GNU/Linux

Error creating thumbnail: sh: /usr/bin/convert: No such file or directory Error code: 127
VPython running in Ubuntu 15.04

Some Linux distributions include VPython in their repositories. For example, to install VPython in Ubuntu 15.04:

sudo apt-get install python-visual


If your Linux distribution's repository does not have the latest version of VPython, you can run the Windows version using Wine. The VPython Linux installation guide contains detailed instructions.

Getting started with Python

Introduction to basic Python use

Creating VPython Objects

  1. Sphere
  2. Arrow
  3. Updating objects

Useful built-in functions

Vectors

  1. cross(vectorA, vectorB)
  2. mag(vector)

Connectedness

  1. How is this topic connected to something that you are interested in?
  2. How is it connected to your major?
  3. Is there an interesting industrial application?

History

Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.

VPython was originally released in 2000 by David Scherer after he took an introductory physics class at Carnegie Mellon University. At the time, the school used the cT programming language for 2D modeling, and David saw the need for something better. Working with several people including professors Ruth Chabay and Bruce Sherwood, he developed a Python module called Visual. Visual Python or VPython featured 3D modeling, as well as an easier-to-understand object-oriented syntax. VPython is released under an Open Source license, and development continues today.

See also

Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?

See the VPython Basics wiki page for getting started with Python programming.

Further reading

Books, Articles or other print media on this topic

External links

Internet resources on this topic

References

This section contains the the references you used while writing this page

1. The cT Programming Language

2. VPython Wiki Site