<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.physicsbook.gatech.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lnikolenko3</id>
	<title>Physics Book - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://www.physicsbook.gatech.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lnikolenko3"/>
	<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/Special:Contributions/Lnikolenko3"/>
	<updated>2026-05-01T07:57:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.7</generator>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15918</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15918"/>
		<updated>2015-12-05T21:53:50Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. It is a good practice to give your variables meaningful names, so the code will become less confusing for you and other people reading it. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
In VPython you can create an object with certain attributes (e.g. radius, position). You can store the information about that object in a variable. This way you can access a certain object using a variable it is stored in.&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
==The structure of VPython program==&lt;br /&gt;
A typical VPython program has the following structure:&lt;br /&gt;
*Declare all the constants that will be used in the physical process you are going to model&lt;br /&gt;
*Create all the objects that are taking part in the process&lt;br /&gt;
*Start a while loop&lt;br /&gt;
*Calculate the forces on the given objects (or any other factors that alter the position of the given objects)&lt;br /&gt;
*Alter the positions (or other variables you need to alter) of the given objects to observe their trajectory&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
This program uses a simple algorithm that produces an approximate motion of Earth around the Sun. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
from __future__ import division&lt;br /&gt;
from visual import *&lt;br /&gt;
&lt;br /&gt;
r=5.0&lt;br /&gt;
theta=0.0&lt;br /&gt;
dtheta=0.01&lt;br /&gt;
sun=sphere(color=color.yellow)&lt;br /&gt;
earth=sphere(pos=(r,0,0),color=color.blue)&lt;br /&gt;
t = 0&lt;br /&gt;
while (t &amp;lt; 60):&lt;br /&gt;
    rate(20)&lt;br /&gt;
    theta=theta+dtheta&lt;br /&gt;
    x=r*cos(theta)&lt;br /&gt;
    y=r*sin(theta)&lt;br /&gt;
    earth.pos=(x,y,0)&lt;br /&gt;
    t = t + 0.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
[[File:Earth_Sun.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
5. [http://www.phy.uct.ac.za/courses/python/examples/examples.html#example-1 Code source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15909</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15909"/>
		<updated>2015-12-05T21:51:54Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* The structure of VPython program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. It is a good practice to give your variables meaningful names, so the code will become less confusing for you and other people reading it. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
In VPython you can create an object with certain attributes (e.g. radius, position). You can store the information about those object in variables. This way you can access a certain object using a variable it is stored in.&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
==The structure of VPython program==&lt;br /&gt;
A typical VPython program has the following structure:&lt;br /&gt;
*Declare all the constants that will be used in the physical process you are going to model&lt;br /&gt;
*Create all the objects that are taking part in the process&lt;br /&gt;
*Start a while loop&lt;br /&gt;
*Calculate the forces on the given objects (or any other factors that alter the position of the given objects)&lt;br /&gt;
*Alter the positions (or other variables you need to alter) of the given objects to observe their trajectory&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
This program uses a simple algorithm that produces an approximate motion of Earth around the Sun. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
from __future__ import division&lt;br /&gt;
from visual import *&lt;br /&gt;
&lt;br /&gt;
r=5.0&lt;br /&gt;
theta=0.0&lt;br /&gt;
dtheta=0.01&lt;br /&gt;
sun=sphere(color=color.yellow)&lt;br /&gt;
earth=sphere(pos=(r,0,0),color=color.blue)&lt;br /&gt;
t = 0&lt;br /&gt;
while (t &amp;lt; 60):&lt;br /&gt;
    rate(20)&lt;br /&gt;
    theta=theta+dtheta&lt;br /&gt;
    x=r*cos(theta)&lt;br /&gt;
    y=r*sin(theta)&lt;br /&gt;
    earth.pos=(x,y,0)&lt;br /&gt;
    t = t + 0.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
[[File:Earth_Sun.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
5. [http://www.phy.uct.ac.za/courses/python/examples/examples.html#example-1 Code source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15894</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15894"/>
		<updated>2015-12-05T21:50:37Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. It is a good practice to give your variables meaningful names, so the code will become less confusing for you and other people reading it. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
In VPython you can create an object with certain attributes (e.g. radius, position). You can store the information about those object in variables. This way you can access a certain object using a variable it is stored in.&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
==The structure of VPython program==&lt;br /&gt;
A typical VPython program has the following structure:&lt;br /&gt;
*Declare all the constants that will be used in the physical process you are going to model&lt;br /&gt;
*Create all the objects that are taking part in the process&lt;br /&gt;
*Start a while loop&lt;br /&gt;
*Calculate the forces on the given objects (or any other factors that alter the position of the given objects)&lt;br /&gt;
*Alter the positions of the given objects to observe their trajectory&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
This program uses a simple algorithm that produces an approximate motion of Earth around the Sun. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
from __future__ import division&lt;br /&gt;
from visual import *&lt;br /&gt;
&lt;br /&gt;
r=5.0&lt;br /&gt;
theta=0.0&lt;br /&gt;
dtheta=0.01&lt;br /&gt;
sun=sphere(color=color.yellow)&lt;br /&gt;
earth=sphere(pos=(r,0,0),color=color.blue)&lt;br /&gt;
t = 0&lt;br /&gt;
while (t &amp;lt; 60):&lt;br /&gt;
    rate(20)&lt;br /&gt;
    theta=theta+dtheta&lt;br /&gt;
    x=r*cos(theta)&lt;br /&gt;
    y=r*sin(theta)&lt;br /&gt;
    earth.pos=(x,y,0)&lt;br /&gt;
    t = t + 0.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
[[File:Earth_Sun.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
5. [http://www.phy.uct.ac.za/courses/python/examples/examples.html#example-1 Code source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15891</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15891"/>
		<updated>2015-12-05T21:50:23Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. It is a good practice to give your variables meaningful names, so the code will become less confusing for you and other people reading it. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
In VPython you can create an object with certain attributes (e.g. radius, position). You can store the information about those object in variables. This way you can access a certain object using a variable it is stored in.&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
==The structure of VPython program==&lt;br /&gt;
A typical VPython program has the following structure:&lt;br /&gt;
*Declare all the constants that will be used in the physical process you are going to model&lt;br /&gt;
*Create all the objects that are taking part in the process&lt;br /&gt;
*Start a while loop&lt;br /&gt;
*Calculate the forces on the given objects (or any other factors that alter the position of the given objects)&lt;br /&gt;
*Alter the positions of the given objects to observe their trajectory&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
This program uses a simple algorithm that produces an approximate motion of Earth around the Sun. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
from __future__ import division&lt;br /&gt;
from visual import *&lt;br /&gt;
&lt;br /&gt;
r=5.0&lt;br /&gt;
theta=0.0&lt;br /&gt;
dtheta=0.01&lt;br /&gt;
sun=sphere(color=color.yellow)&lt;br /&gt;
earth=sphere(pos=(r,0,0),color=color.blue)&lt;br /&gt;
t = 0&lt;br /&gt;
while (t &amp;lt; 60):&lt;br /&gt;
    rate(20)&lt;br /&gt;
    theta=theta+dtheta&lt;br /&gt;
    x=r*cos(theta)&lt;br /&gt;
    y=r*sin(theta)&lt;br /&gt;
    earth.pos=(x,y,0)&lt;br /&gt;
    t = t + 0.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
[[File:Earth_Sun.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
5. [http://www.phy.uct.ac.za/courses/python/examples/examples.html#example-1 | Code source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Earth_Sun.jpg&amp;diff=15863</id>
		<title>File:Earth Sun.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Earth_Sun.jpg&amp;diff=15863"/>
		<updated>2015-12-05T21:47:09Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: Lnikolenko3 uploaded a new version of &amp;amp;quot;File:Earth Sun.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15839</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15839"/>
		<updated>2015-12-05T21:43:07Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* The structure of VPython program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. It is a good practice to give your variables meaningful names, so the code will become less confusing for you and other people reading it. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
In VPython you can create an object with certain attributes (e.g. radius, position). You can store the information about those object in variables. This way you can access a certain object using a variable it is stored in.&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
==The structure of VPython program==&lt;br /&gt;
A typical VPython program has the following structure:&lt;br /&gt;
*Declare all the constants that will be used in the physical process you are going to model&lt;br /&gt;
*Create all the objects that are taking part in the process&lt;br /&gt;
*Start a while loop&lt;br /&gt;
*Calculate the forces on the given objects (or any other factors that alter the position of the given objects)&lt;br /&gt;
*Alter the positions of the given objects to observe their trajectory&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
This program uses a simple algorithm that produces an approximate motion of Earth around the Sun. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
from __future__ import division&lt;br /&gt;
from visual import *&lt;br /&gt;
&lt;br /&gt;
r=5.0&lt;br /&gt;
theta=0.0&lt;br /&gt;
dtheta=0.01&lt;br /&gt;
sun=sphere(color=color.yellow)&lt;br /&gt;
earth=sphere(pos=(r,0,0),color=color.blue)&lt;br /&gt;
t = 0&lt;br /&gt;
while (t &amp;lt; 60):&lt;br /&gt;
    rate(20)&lt;br /&gt;
    theta=theta+dtheta&lt;br /&gt;
    x=r*cos(theta)&lt;br /&gt;
    y=r*sin(theta)&lt;br /&gt;
    earth.pos=(x,y,0)&lt;br /&gt;
    t = t + 0.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
[[File:Earth_Sun.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Earth_Sun.jpg&amp;diff=15835</id>
		<title>File:Earth Sun.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Earth_Sun.jpg&amp;diff=15835"/>
		<updated>2015-12-05T21:42:10Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15803</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15803"/>
		<updated>2015-12-05T21:39:06Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. It is a good practice to give your variables meaningful names, so the code will become less confusing for you and other people reading it. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
In VPython you can create an object with certain attributes (e.g. radius, position). You can store the information about those object in variables. This way you can access a certain object using a variable it is stored in.&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
==The structure of VPython program==&lt;br /&gt;
A typical VPython program has the following structure:&lt;br /&gt;
*Declare all the constants that will be used in the physical process you are going to model&lt;br /&gt;
*Create all the objects that are taking part in the process&lt;br /&gt;
*Start a while loop&lt;br /&gt;
*Calculate the forces on the given objects (or any other factors that alter the position of the given objects)&lt;br /&gt;
*Alter the positions of the given objects to observe their trajectory&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
This program uses a simple algorithm that produces an approximate motion of Earth around the Sun. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
from __future__ import division&lt;br /&gt;
from visual import *&lt;br /&gt;
&lt;br /&gt;
r=5.0&lt;br /&gt;
theta=0.0&lt;br /&gt;
dtheta=0.01&lt;br /&gt;
sun=sphere(color=color.yellow)&lt;br /&gt;
earth=sphere(pos=(r,0,0),color=color.blue)&lt;br /&gt;
t = 0&lt;br /&gt;
while (t &amp;lt; 60):&lt;br /&gt;
    rate(20)&lt;br /&gt;
    theta=theta+dtheta&lt;br /&gt;
    x=r*cos(theta)&lt;br /&gt;
    y=r*sin(theta)&lt;br /&gt;
    earth.pos=(x,y,0)&lt;br /&gt;
    t = t + 0.1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15676</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15676"/>
		<updated>2015-12-05T21:19:55Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. It is a good practice to give your variables meaningful names, so the code will become less confusing for you and other people reading it. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
In VPython you can create an object with certain attributes (e.g. radius, position). You can store the information about those object in variables. This way you can access a certain object using a variable it is stored in.&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15526</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15526"/>
		<updated>2015-12-05T21:03:08Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Debugging techniques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. It is a good practice to give your variables meaningful names, so the code will become less confusing for you and other people reading it. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15502</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15502"/>
		<updated>2015-12-05T21:01:20Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. It is a good practice to give your variables meaningful names, so the code will become less confusing for you and other people reading it. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]]&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15456</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=15456"/>
		<updated>2015-12-05T20:57:13Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Debugging techniques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
For further information on debugging see [[VPython_Common_Errors_and_Troubleshooting | VPython Common Errors and Troubleshooting]]&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:VPython]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10737</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10737"/>
		<updated>2015-12-03T21:05:03Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Debugging techniques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10735</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10735"/>
		<updated>2015-12-03T21:04:06Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Debugging techniques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; equivalent to &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10734</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10734"/>
		<updated>2015-12-03T21:03:53Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Debugging techniques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / y * z&amp;lt;/code&amp;gt; is &#039;&#039;&#039;not&#039;&#039;&#039; the equivalent to &amp;lt;code&amp;gt;x / (y * z)&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10727</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10727"/>
		<updated>2015-12-03T21:01:04Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Vectors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / y * z ! = x / (y * z)&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*&amp;lt;code&amp;gt;cross(vectorA, vectorB)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*&amp;lt;code&amp;gt;mag(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;norm(vector)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*&amp;lt;code&amp;gt;dot(vector_1, vector_2)&amp;lt;/code&amp;gt;&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10724</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10724"/>
		<updated>2015-12-03T21:00:07Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Useful built-in functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / y * z ! = x / (y * z)&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*&amp;lt;code&amp;gt;x**y&amp;lt;/code&amp;gt;&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10722</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10722"/>
		<updated>2015-12-03T20:59:50Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Printing out information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / y * z ! = x / (y * z)&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*&amp;lt;code&amp;gt;print(value)&amp;lt;/code&amp;gt;&lt;br /&gt;
Prints out the given value in the programming shell.&lt;br /&gt;
&lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10721</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10721"/>
		<updated>2015-12-03T20:59:26Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Debugging techniques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / y * z ! = x / (y * z)&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10720</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10720"/>
		<updated>2015-12-03T20:59:08Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Debugging techniques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. &amp;lt;code&amp;gt;x / y*z ! = x / (y * z)&amp;lt;/code&amp;gt;)&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work.&lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10719</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10719"/>
		<updated>2015-12-03T20:58:24Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Comments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = x + 1 # incrementing x variable&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10716</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10716"/>
		<updated>2015-12-03T20:57:51Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Loops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
while (t &amp;lt; 60)&lt;br /&gt;
  distance = distance + velocity * deltat&lt;br /&gt;
  t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10714</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10714"/>
		<updated>2015-12-03T20:57:26Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Loops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&amp;lt;/code&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10713</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10713"/>
		<updated>2015-12-03T20:56:33Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Manipulating VPython values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &amp;lt;code&amp;gt;object.attribute&amp;lt;/code&amp;gt; (e.g. to access the position of the ball variable, you should do &amp;lt;code&amp;gt;ball.pos&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &amp;lt;code&amp;gt;variable = variable + delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10712</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10712"/>
		<updated>2015-12-03T20:55:36Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
&amp;lt;code&amp;gt;myVector = vector(x_coordinate,y_coordinate,z_coordinate)&amp;lt;/code&amp;gt;&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &amp;lt;code&amp;gt;make_trail=True&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ball.make_trail = True&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10708</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10708"/>
		<updated>2015-12-03T20:54:02Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Getting started with Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &amp;lt;code&amp;gt;x = y&amp;lt;/code&amp;gt; assigns the variable x value 0, while the statement &amp;lt;code&amp;gt;y = x&amp;lt;/code&amp;gt; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10707</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10707"/>
		<updated>2015-12-03T20:53:17Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Getting started with Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10706</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10706"/>
		<updated>2015-12-03T20:52:26Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Getting started with Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10704</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10704"/>
		<updated>2015-12-03T20:51:51Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10700</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10700"/>
		<updated>2015-12-03T20:51:08Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10698</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10698"/>
		<updated>2015-12-03T20:50:04Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
x = 5&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10691</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10691"/>
		<updated>2015-12-03T20:48:08Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Loops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] as a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10689</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10689"/>
		<updated>2015-12-03T20:47:51Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Loops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction | Iterative Prediction]] to see a good example of the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10683</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10683"/>
		<updated>2015-12-03T20:46:58Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction]] to see the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10677</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10677"/>
		<updated>2015-12-03T20:43:23Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* GlowScript */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction]] to see the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. One of the greatest strengths of GlowScript is that is does not require any pre-installed software and can be ran from any computer.&lt;br /&gt;
&lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10672</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10672"/>
		<updated>2015-12-03T20:41:24Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Loops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up (see [[Iterative_Prediction]] to see the physical application of a while loop). While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10659</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=10659"/>
		<updated>2015-12-03T20:36:30Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Vectors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
*dot(vector_1, vector_2)&lt;br /&gt;
Calculates the dot product of two vectors&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8677</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8677"/>
		<updated>2015-12-03T00:22:12Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8672</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8672"/>
		<updated>2015-12-03T00:20:32Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8670</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8670"/>
		<updated>2015-12-03T00:20:04Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8668</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8668"/>
		<updated>2015-12-03T00:19:16Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
[[File:Trail1.jpg]]&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Trail1.jpg&amp;diff=8666</id>
		<title>File:Trail1.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Trail1.jpg&amp;diff=8666"/>
		<updated>2015-12-03T00:18:43Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8659</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8659"/>
		<updated>2015-12-03T00:17:29Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
*[http://vpython.org/contents/docs/trail.html Trail]&lt;br /&gt;
You can leave a trail behind a moving object simply by specifying &#039;&#039;make_trail=True&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
ball.make_trail = True&lt;br /&gt;
&lt;br /&gt;
Each time you change ball.pos, this new position is added to a curve, thereby leaving a trail behind the moving sphere. This works with arrow, box, cone, cylinder, ellipsoid, pyramid, ring, and sphere.&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8606</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8606"/>
		<updated>2015-12-02T23:32:41Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8605</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8605"/>
		<updated>2015-12-02T23:32:29Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8496</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8496"/>
		<updated>2015-12-02T22:06:30Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8495</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8495"/>
		<updated>2015-12-02T22:06:17Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8493</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8493"/>
		<updated>2015-12-02T22:05:58Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8492</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8492"/>
		<updated>2015-12-02T22:05:34Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8491</id>
		<title>VPython basics</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_basics&amp;diff=8491"/>
		<updated>2015-12-02T22:05:03Z</updated>

		<summary type="html">&lt;p&gt;Lnikolenko3: /* Creating VPython Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Liubov Nikolenko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a beginner guide to programming in VPython. If you have never written code before, this article is for you. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EMWave-Maxwell v275.gif]]&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
To install VPython simply follow the instructions in the links given below. After the installation is completed just open the VIDLE for Python (usually there is a shortcut created on your desktop) and start typing your code.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_windows.html here]&lt;br /&gt;
&lt;br /&gt;
===OSX===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_mac.html here]&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Install VPython [http://vpython.org/contents/download_linux.html here]&lt;br /&gt;
&lt;br /&gt;
==Getting started with Python==&lt;br /&gt;
Introduction to basic Python use&lt;br /&gt;
&lt;br /&gt;
The first two lines of your program should be:&lt;br /&gt;
::from __future__ import division&lt;br /&gt;
::from visual import *&lt;br /&gt;
The first line enables float division, so 3 / 2 = 1.5 (not 1) and the second line enables graphics module.&lt;br /&gt;
===Variables===&lt;br /&gt;
One of the most powerful features of a programming language is the ability to manipulate variables. A variable is a name that refers to a value. In order to assign some value to a variable, you should use the assignment token = . &lt;br /&gt;
For example, &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value 5. &lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
x = y&lt;br /&gt;
&lt;br /&gt;
This line of code assigns the variable x the value associated with y, so x is equal to 0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; unlike equality operator you cannot interchange the variables on different sides of the equality sign. &lt;br /&gt;
Say, our initial conditions are: &lt;br /&gt;
&lt;br /&gt;
x = 5&lt;br /&gt;
&lt;br /&gt;
y = 0&lt;br /&gt;
&lt;br /&gt;
The statement &#039;&#039;x = y&#039;&#039; assigns the variable x value 0, while the statement &#039;&#039;y = x&#039;&#039; assigns the variable y value 5.&lt;br /&gt;
&lt;br /&gt;
===Creating VPython Objects===&lt;br /&gt;
*[http://vpython.org/contents/docs/sphere.html Sphere]&lt;br /&gt;
ball = sphere(pos=(x_coordinate,y_coordinate,z_coordinate), radius=radius_of_the_sphere, color = color.color_of_the_sphere)&lt;br /&gt;
[[File:Sphere.jpg]]&lt;br /&gt;
*[http://vpython.org/contents/docs/arrow.html Arrow]&lt;br /&gt;
myArrow = arrow(pos=(x0_coordinate,y0_coordinate,z0_coordinate), axis=(x1_coordinate,y1_coordinate,z1_coordinate), color = color.color_of_the_arrow)&lt;br /&gt;
[[File:Arrow1.jpg]]&lt;br /&gt;
*[http://vpython.org/contents/docs/vector.html Vector]&lt;br /&gt;
myVector = vector(x_coordinate,y_coordinate,z_coordinate)&lt;br /&gt;
&lt;br /&gt;
===Manipulating VPython values===&lt;br /&gt;
*Accessing attributes of the variable&lt;br /&gt;
To access the attribute of a given variable just use the syntax &#039;&#039;object.attribute&#039;&#039; (e.g. to access the position of the ball variable, you should do &#039;&#039;ball.pos&#039;&#039;)&lt;br /&gt;
*Updating variable&lt;br /&gt;
To update a variable (such as time, speed, force or the position of the object) you should do &#039;&#039;variable = variable + delta&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running VPython code===&lt;br /&gt;
To run VPython code simply press F5. While running your code you will see the visual module and a shell (a place where all print out information is displayed) &lt;br /&gt;
===Loops===&lt;br /&gt;
There are two types of loops that can be use in Python: [https://wiki.python.org/moin/ForLoop for loop] and [https://wiki.python.org/moin/WhileLoop while loop]. Basically, loops are used to tell the computer to execute the same task multiple times. While loops are more common for modeling physics concepts.&lt;br /&gt;
*While loops &lt;br /&gt;
The body of a while loop is executed, while a certain condition is true. Make sure to indent the statements that should be done in the while loop. While loop is equivalent to integration, because it manually breaks down the physical process into small parts and adds them up. While loop has the following structure:&lt;br /&gt;
:while (condition)&lt;br /&gt;
::the body of the while loop&lt;br /&gt;
::updating the loop&lt;br /&gt;
For example:&lt;br /&gt;
:while (t &amp;lt; 60)&lt;br /&gt;
::distance = distance + velocity * deltat&lt;br /&gt;
::t = t + deltat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; to see the process clearly it is common to slow down the frame rate by using &#039;&#039;rate(200)&#039;&#039; as a first line of a body of the while loop&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
Comments in the code have no impact on the code execution, because they are just ignored by the computer. Comments in VPython start with a pound sign (#) and end when a line ends. It is a good practice to place some useful information (like an explanation to a certain step) in the comments, so other people will find it easier to understand your code. For example:&lt;br /&gt;
&lt;br /&gt;
x = x + 1 # incrementing x variable &lt;br /&gt;
===Debugging techniques===&lt;br /&gt;
Unfortunately, sometimes programs do not work in a way we intended them to work. Here are some tips to fixing your code. &lt;br /&gt;
#If you get an error try to understand the error message and fix your code accordingly. The most common errors are syntax errors, like parenthesis mismatch or wrong arguments passed into the function. &lt;br /&gt;
#Make sure you updating your condition for a while loop, so you don&#039;t have an infinite loop. &lt;br /&gt;
#Check if your are dividing by zero anywhere. &lt;br /&gt;
#Make sure you have correct indentation everywhere. &lt;br /&gt;
#Put plenty of &#039;&#039;print()&#039;&#039; statements, so you can know what is going on in every single stage of your code.&lt;br /&gt;
#Check your mathematical expressions for the order of precedence (e.g. x / y*z ! = x / (y * z))&lt;br /&gt;
#Try commenting out some steps to see which parts of your code do not work. &lt;br /&gt;
&lt;br /&gt;
===Useful built-in functions===&lt;br /&gt;
====Printing out information====&lt;br /&gt;
*print(value)&lt;br /&gt;
Prints out the given value in the programming shell. &lt;br /&gt;
====Math====&lt;br /&gt;
*x**y&lt;br /&gt;
Raises x to the y-th power.&lt;br /&gt;
===Vectors===&lt;br /&gt;
*cross(vectorA, vectorB)&lt;br /&gt;
Calculates the cross product of two vectors&lt;br /&gt;
*mag(vector)&lt;br /&gt;
Calculates the magnitude of the vector&lt;br /&gt;
*norm(vector)&lt;br /&gt;
Calculates the unit vector of the vector&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
&lt;br /&gt;
I like coding and I would love more people to share my passion, so I tried my best to make the coding part of physics more approachable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
&lt;br /&gt;
I am CS major and Python was the first language I have learned at Tech.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
&lt;br /&gt;
Every simulation starting from interaction of molecules can be modeled in VPython to get the general idea of the process.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
===GlowScript===&lt;br /&gt;
[http://www.glowscript.org/ GlowScript] is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web. You can write and run GlowScript programs right in your browser, store them in the cloud for free, and easily share them with others. GlowScript uses VPython as a programming language. &lt;br /&gt;
===General Overview of VPython===&lt;br /&gt;
[[VPython]]&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
[http://vpython.org/ The official VPython website with the links to YouTube tutorials]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/doc.html Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/?fromgroups&amp;amp;hl=en#!forum/vpython-users VPython User forum]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
This section contains the the references you used while writing this page&lt;br /&gt;
&lt;br /&gt;
1. [http://openbookproject.net/thinkcs/python/english3e/index.html Python tutorial]&lt;br /&gt;
&lt;br /&gt;
2. [http://vpython.wikidot.com/ VPython Wiki Site]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.glowscript.org/ GlowScript]&lt;br /&gt;
&lt;br /&gt;
4. [http://www.visualrelativity.com/vpython/ The image source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Which Category did you place this in?]]&lt;/div&gt;</summary>
		<author><name>Lnikolenko3</name></author>
	</entry>
</feed>