<?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=Mpowers42</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=Mpowers42"/>
	<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/Special:Contributions/Mpowers42"/>
	<updated>2026-04-08T06:15:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.7</generator>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32263</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32263"/>
		<updated>2018-11-07T17:49:15Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* VPython Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &amp;lt;br&amp;gt;&lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &amp;lt;br&amp;gt;&lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &amp;lt;br&amp;gt;&lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&amp;lt;br&amp;gt;&lt;br /&gt;
 x = 5&lt;br /&gt;
 x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
 myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
 #Addition: &lt;br /&gt;
 1+2 #This will equal 3.&lt;br /&gt;
 #Subtraction: &lt;br /&gt;
 2-1 #This will equal 1.&lt;br /&gt;
 #Multiplication: &lt;br /&gt;
 2*1 #This will equal 2.&lt;br /&gt;
 #Division: &lt;br /&gt;
 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
 #Exponentiation: &lt;br /&gt;
 2**2 #This will equal 4.&lt;br /&gt;
 #Square root: &lt;br /&gt;
 sqrt(4) #This will equal 2.&lt;br /&gt;
 #Remainder: &lt;br /&gt;
 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
 print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
 print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
 print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
 if x &amp;gt; 1:&lt;br /&gt;
 	print(“x is greater than 1”)&lt;br /&gt;
 elif x = 1:&lt;br /&gt;
 	print(“x is equal to 1”)&lt;br /&gt;
 else:&lt;br /&gt;
 	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
 for i in range(1,11):&lt;br /&gt;
 	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
 1&lt;br /&gt;
 2&lt;br /&gt;
 3&lt;br /&gt;
 4&lt;br /&gt;
 5&lt;br /&gt;
 6&lt;br /&gt;
 7&lt;br /&gt;
 8&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice it is indented!&lt;br /&gt;
 while i &amp;gt; 1:&lt;br /&gt;
 	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
 x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
 if x == 2:&lt;br /&gt;
 	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
==Starting Your VPython Program==&lt;br /&gt;
To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
 from__future__ import division&lt;br /&gt;
 from visual import*&lt;br /&gt;
    &lt;br /&gt;
The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
 scene.width = 1024&lt;br /&gt;
 scene.height = 760&lt;br /&gt;
&lt;br /&gt;
==Vectors==&lt;br /&gt;
You can access each component of the vector with pos.x, pos.y, or pos.z, depending on which component you want. You access an object&#039;s field with a period following the variable name.&lt;br /&gt;
 pos = vector(1, 2, 3)&lt;br /&gt;
 xComponent = pos.x  #This value would be 1&lt;br /&gt;
 yComponent = pos.y  #This value would be 2&lt;br /&gt;
 zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
You can add two or more vectors together and you can multiply a vector by a scalar. Keep in mind you cannot add a vector and a scalar.&lt;br /&gt;
 #Adding&lt;br /&gt;
 A = vector(1, 2, 3)&lt;br /&gt;
 B = vector(4, 5, 6)&lt;br /&gt;
 C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
 # Multiplying&lt;br /&gt;
 D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
&lt;br /&gt;
To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
 initialPos = vector(10, 3, 0)&lt;br /&gt;
 finalPos = vector(30, 15, 0)&lt;br /&gt;
 deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
 rMag = mag(finalPos)&lt;br /&gt;
 rHat = norm(finalPos)&lt;br /&gt;
 errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shapes==&lt;br /&gt;
&lt;br /&gt;
There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc. If you were to make, say, a ball, you would want to draw a sphere. It has a position field, a radius field, and a color field. When creating a new instance of an object, each field is comma separated. You access each field the same way as we did with the position vector.&lt;br /&gt;
 ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
 ballColor = ball.color&lt;br /&gt;
 ballPos = ball.pos&lt;br /&gt;
 ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
You can draw arrows. These also have a color and position field, but instead of a radius, they have an axis that determines their length. These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
 velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
There are also boxes. They have a position vector and a size vector.&lt;br /&gt;
 myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
You can draw helixes, which are useful for depicting springs. They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
 spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
==Tracing==&lt;br /&gt;
&lt;br /&gt;
If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
 posTrace = curve(color = color.yellow)&lt;br /&gt;
 trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
==Graphs==&lt;br /&gt;
&lt;br /&gt;
You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
 Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
 Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
 KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
 # For each time step...&lt;br /&gt;
 Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
 Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
 KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32262</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32262"/>
		<updated>2018-11-07T17:41:58Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Equal Signs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &amp;lt;br&amp;gt;&lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &amp;lt;br&amp;gt;&lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &amp;lt;br&amp;gt;&lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&amp;lt;br&amp;gt;&lt;br /&gt;
 x = 5&lt;br /&gt;
 x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
 myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
 #Addition: &lt;br /&gt;
 1+2 #This will equal 3.&lt;br /&gt;
 #Subtraction: &lt;br /&gt;
 2-1 #This will equal 1.&lt;br /&gt;
 #Multiplication: &lt;br /&gt;
 2*1 #This will equal 2.&lt;br /&gt;
 #Division: &lt;br /&gt;
 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
 #Exponentiation: &lt;br /&gt;
 2**2 #This will equal 4.&lt;br /&gt;
 #Square root: &lt;br /&gt;
 sqrt(4) #This will equal 2.&lt;br /&gt;
 #Remainder: &lt;br /&gt;
 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
 print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
 print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
 print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
 if x &amp;gt; 1:&lt;br /&gt;
 	print(“x is greater than 1”)&lt;br /&gt;
 elif x = 1:&lt;br /&gt;
 	print(“x is equal to 1”)&lt;br /&gt;
 else:&lt;br /&gt;
 	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
 for i in range(1,11):&lt;br /&gt;
 	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
 1&lt;br /&gt;
 2&lt;br /&gt;
 3&lt;br /&gt;
 4&lt;br /&gt;
 5&lt;br /&gt;
 6&lt;br /&gt;
 7&lt;br /&gt;
 8&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice it is indented!&lt;br /&gt;
 while i &amp;gt; 1:&lt;br /&gt;
 	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
 x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
 if x == 2:&lt;br /&gt;
 	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32261</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32261"/>
		<updated>2018-11-07T17:41:46Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Loop */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &amp;lt;br&amp;gt;&lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &amp;lt;br&amp;gt;&lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &amp;lt;br&amp;gt;&lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&amp;lt;br&amp;gt;&lt;br /&gt;
 x = 5&lt;br /&gt;
 x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
 myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
 #Addition: &lt;br /&gt;
 1+2 #This will equal 3.&lt;br /&gt;
 #Subtraction: &lt;br /&gt;
 2-1 #This will equal 1.&lt;br /&gt;
 #Multiplication: &lt;br /&gt;
 2*1 #This will equal 2.&lt;br /&gt;
 #Division: &lt;br /&gt;
 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
 #Exponentiation: &lt;br /&gt;
 2**2 #This will equal 4.&lt;br /&gt;
 #Square root: &lt;br /&gt;
 sqrt(4) #This will equal 2.&lt;br /&gt;
 #Remainder: &lt;br /&gt;
 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
 print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
 print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
 print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
 if x &amp;gt; 1:&lt;br /&gt;
 	print(“x is greater than 1”)&lt;br /&gt;
 elif x = 1:&lt;br /&gt;
 	print(“x is equal to 1”)&lt;br /&gt;
 else:&lt;br /&gt;
 	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
 for i in range(1,11):&lt;br /&gt;
 	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
 1&lt;br /&gt;
 2&lt;br /&gt;
 3&lt;br /&gt;
 4&lt;br /&gt;
 5&lt;br /&gt;
 6&lt;br /&gt;
 7&lt;br /&gt;
 8&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice it is indented!&lt;br /&gt;
 while i &amp;gt; 1:&lt;br /&gt;
 	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32260</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32260"/>
		<updated>2018-11-07T17:41:10Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Conditional */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &amp;lt;br&amp;gt;&lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &amp;lt;br&amp;gt;&lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &amp;lt;br&amp;gt;&lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&amp;lt;br&amp;gt;&lt;br /&gt;
 x = 5&lt;br /&gt;
 x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
 myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
 #Addition: &lt;br /&gt;
 1+2 #This will equal 3.&lt;br /&gt;
 #Subtraction: &lt;br /&gt;
 2-1 #This will equal 1.&lt;br /&gt;
 #Multiplication: &lt;br /&gt;
 2*1 #This will equal 2.&lt;br /&gt;
 #Division: &lt;br /&gt;
 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
 #Exponentiation: &lt;br /&gt;
 2**2 #This will equal 4.&lt;br /&gt;
 #Square root: &lt;br /&gt;
 sqrt(4) #This will equal 2.&lt;br /&gt;
 #Remainder: &lt;br /&gt;
 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
 print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
 print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
 print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
 if x &amp;gt; 1:&lt;br /&gt;
 	print(“x is greater than 1”)&lt;br /&gt;
 elif x = 1:&lt;br /&gt;
 	print(“x is equal to 1”)&lt;br /&gt;
 else:&lt;br /&gt;
 	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
for i in range(1,11):&lt;br /&gt;
	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
4&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&lt;br /&gt;
9&lt;br /&gt;
10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice is it indented!&lt;br /&gt;
while i &amp;gt; 1:&lt;br /&gt;
	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32259</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32259"/>
		<updated>2018-11-07T17:40:42Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Print Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &amp;lt;br&amp;gt;&lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &amp;lt;br&amp;gt;&lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &amp;lt;br&amp;gt;&lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&amp;lt;br&amp;gt;&lt;br /&gt;
 x = 5&lt;br /&gt;
 x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
 myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
 #Addition: &lt;br /&gt;
 1+2 #This will equal 3.&lt;br /&gt;
 #Subtraction: &lt;br /&gt;
 2-1 #This will equal 1.&lt;br /&gt;
 #Multiplication: &lt;br /&gt;
 2*1 #This will equal 2.&lt;br /&gt;
 #Division: &lt;br /&gt;
 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
 #Exponentiation: &lt;br /&gt;
 2**2 #This will equal 4.&lt;br /&gt;
 #Square root: &lt;br /&gt;
 sqrt(4) #This will equal 2.&lt;br /&gt;
 #Remainder: &lt;br /&gt;
 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
 print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
 x = 1 + 1&lt;br /&gt;
 print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
 print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
if x &amp;gt; 1:&lt;br /&gt;
	print(“x is greater than 1”)&lt;br /&gt;
elif x = 1:&lt;br /&gt;
	print(“x is equal to 1”)&lt;br /&gt;
else:&lt;br /&gt;
	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
for i in range(1,11):&lt;br /&gt;
	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
4&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&lt;br /&gt;
9&lt;br /&gt;
10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice is it indented!&lt;br /&gt;
while i &amp;gt; 1:&lt;br /&gt;
	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32258</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32258"/>
		<updated>2018-11-07T17:40:20Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Comments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &amp;lt;br&amp;gt;&lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &amp;lt;br&amp;gt;&lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &amp;lt;br&amp;gt;&lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&amp;lt;br&amp;gt;&lt;br /&gt;
 x = 5&lt;br /&gt;
 x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
 myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
 #Addition: &lt;br /&gt;
 1+2 #This will equal 3.&lt;br /&gt;
 #Subtraction: &lt;br /&gt;
 2-1 #This will equal 1.&lt;br /&gt;
 #Multiplication: &lt;br /&gt;
 2*1 #This will equal 2.&lt;br /&gt;
 #Division: &lt;br /&gt;
 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
 #Exponentiation: &lt;br /&gt;
 2**2 #This will equal 4.&lt;br /&gt;
 #Square root: &lt;br /&gt;
 sqrt(4) #This will equal 2.&lt;br /&gt;
 #Remainder: &lt;br /&gt;
 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
if x &amp;gt; 1:&lt;br /&gt;
	print(“x is greater than 1”)&lt;br /&gt;
elif x = 1:&lt;br /&gt;
	print(“x is equal to 1”)&lt;br /&gt;
else:&lt;br /&gt;
	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
for i in range(1,11):&lt;br /&gt;
	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
4&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&lt;br /&gt;
9&lt;br /&gt;
10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice is it indented!&lt;br /&gt;
while i &amp;gt; 1:&lt;br /&gt;
	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32257</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32257"/>
		<updated>2018-11-07T17:40:05Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &amp;lt;br&amp;gt;&lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &amp;lt;br&amp;gt;&lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &amp;lt;br&amp;gt;&lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&amp;lt;br&amp;gt;&lt;br /&gt;
 x = 5&lt;br /&gt;
 x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
 #Addition: &lt;br /&gt;
 1+2 #This will equal 3.&lt;br /&gt;
 #Subtraction: &lt;br /&gt;
 2-1 #This will equal 1.&lt;br /&gt;
 #Multiplication: &lt;br /&gt;
 2*1 #This will equal 2.&lt;br /&gt;
 #Division: &lt;br /&gt;
 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
 #Exponentiation: &lt;br /&gt;
 2**2 #This will equal 4.&lt;br /&gt;
 #Square root: &lt;br /&gt;
 sqrt(4) #This will equal 2.&lt;br /&gt;
 #Remainder: &lt;br /&gt;
 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
if x &amp;gt; 1:&lt;br /&gt;
	print(“x is greater than 1”)&lt;br /&gt;
elif x = 1:&lt;br /&gt;
	print(“x is equal to 1”)&lt;br /&gt;
else:&lt;br /&gt;
	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
for i in range(1,11):&lt;br /&gt;
	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
4&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&lt;br /&gt;
9&lt;br /&gt;
10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice is it indented!&lt;br /&gt;
while i &amp;gt; 1:&lt;br /&gt;
	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32256</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32256"/>
		<updated>2018-11-07T17:37:46Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Math Operations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&lt;br /&gt;
	x = 5&lt;br /&gt;
	x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
 #Addition: &lt;br /&gt;
 1+2 #This will equal 3.&lt;br /&gt;
 #Subtraction: &lt;br /&gt;
 2-1 #This will equal 1.&lt;br /&gt;
 #Multiplication: &lt;br /&gt;
 2*1 #This will equal 2.&lt;br /&gt;
 #Division: &lt;br /&gt;
 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
 #Exponentiation: &lt;br /&gt;
 2**2 #This will equal 4.&lt;br /&gt;
 #Square root: &lt;br /&gt;
 sqrt(4) #This will equal 2.&lt;br /&gt;
 #Remainder: &lt;br /&gt;
 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
if x &amp;gt; 1:&lt;br /&gt;
	print(“x is greater than 1”)&lt;br /&gt;
elif x = 1:&lt;br /&gt;
	print(“x is equal to 1”)&lt;br /&gt;
else:&lt;br /&gt;
	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
for i in range(1,11):&lt;br /&gt;
	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
4&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&lt;br /&gt;
9&lt;br /&gt;
10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice is it indented!&lt;br /&gt;
while i &amp;gt; 1:&lt;br /&gt;
	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32255</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32255"/>
		<updated>2018-11-07T17:36:39Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Math Operations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&lt;br /&gt;
	x = 5&lt;br /&gt;
	x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
 Addition: 1+2 #This will equal 3.&lt;br /&gt;
 Subtraction: 2-1 #This will equal 1.&lt;br /&gt;
 Multiplication: 2*1 #This will equal 2.&lt;br /&gt;
 Division: 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
 Exponentiation: 2**2 #This will equal 4.&lt;br /&gt;
 Square root: sqrt(4) #This will equal 2.&lt;br /&gt;
 Remainder: 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
if x &amp;gt; 1:&lt;br /&gt;
	print(“x is greater than 1”)&lt;br /&gt;
elif x = 1:&lt;br /&gt;
	print(“x is equal to 1”)&lt;br /&gt;
else:&lt;br /&gt;
	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
for i in range(1,11):&lt;br /&gt;
	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
4&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&lt;br /&gt;
9&lt;br /&gt;
10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice is it indented!&lt;br /&gt;
while i &amp;gt; 1:&lt;br /&gt;
	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32243</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32243"/>
		<updated>2018-11-01T16:55:36Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Python Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=Python Basics=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&lt;br /&gt;
	x = 5&lt;br /&gt;
	x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
Addition: 1+2 #This will equal 3.&lt;br /&gt;
Subtraction: 2-1 #This will equal 1.&lt;br /&gt;
Multiplication: 2*1 #This will equal 2.&lt;br /&gt;
Division: 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
Exponentiation: 2**2 #This will equal 4.&lt;br /&gt;
Square root: sqrt(4) #This will equal 2.&lt;br /&gt;
Remainder: 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
if x &amp;gt; 1:&lt;br /&gt;
	print(“x is greater than 1”)&lt;br /&gt;
elif x = 1:&lt;br /&gt;
	print(“x is equal to 1”)&lt;br /&gt;
else:&lt;br /&gt;
	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
for i in range(1,11):&lt;br /&gt;
	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
4&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&lt;br /&gt;
9&lt;br /&gt;
10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice is it indented!&lt;br /&gt;
while i &amp;gt; 1:&lt;br /&gt;
	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32242</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32242"/>
		<updated>2018-11-01T16:55:23Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* VPython Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=&#039;&#039;&#039;Python Basics&#039;&#039;&#039;=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&lt;br /&gt;
	x = 5&lt;br /&gt;
	x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
Addition: 1+2 #This will equal 3.&lt;br /&gt;
Subtraction: 2-1 #This will equal 1.&lt;br /&gt;
Multiplication: 2*1 #This will equal 2.&lt;br /&gt;
Division: 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
Exponentiation: 2**2 #This will equal 4.&lt;br /&gt;
Square root: sqrt(4) #This will equal 2.&lt;br /&gt;
Remainder: 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
if x &amp;gt; 1:&lt;br /&gt;
	print(“x is greater than 1”)&lt;br /&gt;
elif x = 1:&lt;br /&gt;
	print(“x is equal to 1”)&lt;br /&gt;
else:&lt;br /&gt;
	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
for i in range(1,11):&lt;br /&gt;
	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
4&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&lt;br /&gt;
9&lt;br /&gt;
10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice is it indented!&lt;br /&gt;
while i &amp;gt; 1:&lt;br /&gt;
	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
=VPython Basics=&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32241</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32241"/>
		<updated>2018-11-01T16:55:01Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
=&#039;&#039;&#039;Python Basics&#039;&#039;&#039;=&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
A variable is an item within your code that has information stored in it. This information can be a number, a string of letters, or anything really. &lt;br /&gt;
Variables are identified by a name. The names of your variables should be simple, but logical. Avoid names that include spaces or dots, because Python does not like this syntax. Rather, it is best to separate two words in a variable name by capitalizing the second word, such as “myVariable”, or an underscore, such as “my_variable”. &lt;br /&gt;
Storing items as a variable allows for easy access when they are needed later in your program. &lt;br /&gt;
One last thing that is important to note is that you can reassign variables. For example, the code below is completely valid.&lt;br /&gt;
	x = 5&lt;br /&gt;
	x = x + 2&lt;br /&gt;
When this code is finished running, x will equal 7. Although this is counterintuitive at first, it’s easy to get used to.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Comments are useful when you would like to include something in your code that makes it easier to understand, but it not an actual part of your code. To do this, you include a # sign before anything you would like to comment out. When # is in a line of code, the rest of the code in that line will be ignored when your code is running.&lt;br /&gt;
myTemp = 4 #This is the temperature in Celsius.&lt;br /&gt;
&lt;br /&gt;
==Math Operations==&lt;br /&gt;
&lt;br /&gt;
Math operations are simple in Python. The simple operations, as you might expect, are as follows:&lt;br /&gt;
Addition: 1+2 #This will equal 3.&lt;br /&gt;
Subtraction: 2-1 #This will equal 1.&lt;br /&gt;
Multiplication: 2*1 #This will equal 2.&lt;br /&gt;
Division: 2/1 #This will equal 2.&lt;br /&gt;
There are other operations, that you may want to pay closer attention to.&lt;br /&gt;
Exponentiation: 2**2 #This will equal 4.&lt;br /&gt;
Square root: sqrt(4) #This will equal 2.&lt;br /&gt;
Remainder: 5%4 #This will equal 1.&lt;br /&gt;
&lt;br /&gt;
==Print Function==&lt;br /&gt;
&lt;br /&gt;
In order to see any of the information we’ve listed above, you have to actually print it. For example, the code below will run but will not provide you with an output.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
Instead, you have to print this information in order to see the answer when the code is finished running. You can do this in two ways. First, you can directly imbed the code in your print statement.&lt;br /&gt;
print(1 + 1)&lt;br /&gt;
Or, you can create the variable and then print the variable.&lt;br /&gt;
x = 1 + 1&lt;br /&gt;
print(x)&lt;br /&gt;
Either one is valid!&lt;br /&gt;
If you would like to print something other than a variable, include quotations around it. For example, if you wanted to print the typical “Hello, world!”, you would code:&lt;br /&gt;
print(“Hello, world!”)&lt;br /&gt;
The quotations are the important takeaway here.&lt;br /&gt;
&lt;br /&gt;
==Conditional==&lt;br /&gt;
A conditional involves an “if” statement. “If this thing is true, do this”, for example. Conditionals are useful in physics if you want to perform different things on a variable, depending on certain conditions.&lt;br /&gt;
if x &amp;gt; 1:&lt;br /&gt;
	print(“x is greater than 1”)&lt;br /&gt;
elif x = 1:&lt;br /&gt;
	print(“x is equal to 1”)&lt;br /&gt;
else:&lt;br /&gt;
	print(“x is less than 1”)&lt;br /&gt;
Above is the typical syntax you would see for a conditional. Notice the conditional starts with an if statement, followed by a colon. The next line is indented, and then tells that if statement what to do if the if statement is true. If it is not true, it moves on to the elif statement. Elif statements are used after if statements, but when there is still an if statement involved. There can be endless elif statements. Notice this uses the same syntax as the regular if statement. Lastly, if neither the if nor the elif statement(s) are true, there is an else statement. This will print if nothing above was true.&lt;br /&gt;
&lt;br /&gt;
==Loop==&lt;br /&gt;
A loop iterates through each item in a list or range. Loops can be useful in physics because they are vital to update equations. Loops will automatically update the information for you, rather than having to write out the long iterative process yourself. Below are examples of for loops and while loops.&lt;br /&gt;
for i in range(1,11):&lt;br /&gt;
	print(i)&lt;br /&gt;
The statement above will print:&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
3&lt;br /&gt;
4&lt;br /&gt;
5&lt;br /&gt;
6&lt;br /&gt;
7&lt;br /&gt;
8&lt;br /&gt;
9&lt;br /&gt;
10&lt;br /&gt;
Notice it does not print 11. When inputting a range in Python, the last number is not included. Notice how the for loop states “for”, and then a variable, and then a range, and then a colon. This is then followed by a statement that tells what to do for each iteration in the loop. Notice is it indented!&lt;br /&gt;
while i &amp;gt; 1:&lt;br /&gt;
	print(i)&lt;br /&gt;
This is an example of a while loop. While i is greater than 1, the code will print i. The syntax is similar to the for loop.&lt;br /&gt;
&lt;br /&gt;
==Equal Signs==&lt;br /&gt;
&lt;br /&gt;
“=” and “==” mean two different things in Python. When setting a variable equal to something, you use one equal sign:&lt;br /&gt;
x = 2&lt;br /&gt;
However, when you are using it in something like an if statement, use two equal signs:&lt;br /&gt;
if x == 2:&lt;br /&gt;
	print(“x equals 2)&lt;br /&gt;
&lt;br /&gt;
==VPython Basics==&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32218</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32218"/>
		<updated>2018-10-26T20:10:05Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Python Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
==Python Basics==&lt;br /&gt;
It&#039;s always helpful to have a basic background knowledge of Python before proceeding with the applications more relevant to this course. A useful website for Python syntax is www.stackoverflow.com. &lt;br /&gt;
&lt;br /&gt;
    # Comments start with a number symbol. A comment is writing that does not impact the code in any way. These are essential so that both you, or anyone else doesn&#039;t get lost in the code and can   &lt;br /&gt;
    #easily locate where a bug may be happening. It is encouraged to use these often.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Math operations are calculated as follows. &lt;br /&gt;
    1 + 1  # -&amp;gt; 2&lt;br /&gt;
    2 - 1  # -&amp;gt; 1&lt;br /&gt;
    3 * 2  # -&amp;gt; 6&lt;br /&gt;
    8 / 4  # -&amp;gt; 4&lt;br /&gt;
    (1 + 3) * 2  # -&amp;gt; 8&lt;br /&gt;
    1 + (3 * 2)  # -&amp;gt; 7&lt;br /&gt;
&lt;br /&gt;
    # When using an exponent, rather than using the normal &amp;quot;^&amp;quot;, be sure to use &amp;quot;**&amp;quot; instead.&lt;br /&gt;
    2 ** 3  # -&amp;gt; 8&lt;br /&gt;
&lt;br /&gt;
    # There&#039;s also various math functions you can use, such as the square root function.&lt;br /&gt;
    sqrt(4) # -&amp;gt; 2&lt;br /&gt;
&lt;br /&gt;
    # However, these math operations are useless if we don&#039;t store the values anywhere. A variable can be any combination of letters or numbers. Try to avoid complicated names, and avoid names include periods or spaces. Storing values to a variable allows for said value to be     &lt;br /&gt;
    # accessed again in the future easily.&lt;br /&gt;
    x = 1 + 1&lt;br /&gt;
    # Now if you try to access x in the future, it will have the value of &#039;2&#039;.&lt;br /&gt;
&lt;br /&gt;
    # Printing something writes the input in the shell, so that you can see the results of the output. You can print your variables like this:&lt;br /&gt;
    print(x)&lt;br /&gt;
    # If you would like to print a collection of letters rather than a variable, put them in quotation marks. Use a comma to separate the information in the quotations from the variable.&lt;br /&gt;
    print(&amp;quot;The value of x is &amp;quot;, x)&lt;br /&gt;
&lt;br /&gt;
    # Sometimes we only want to execute something based on a certain condition.&lt;br /&gt;
    if x == 2:&lt;br /&gt;
        y = 3&lt;br /&gt;
    # The &#039;==&#039; means that you&#039;re directly comparing two values. If they&#039;re equal, whatever is on the inside of the if-statement will be executed.&lt;br /&gt;
    # Now is a good time to note that whitespace is very important in Python.&lt;br /&gt;
    # &#039;y = 3&#039; will always execute if it isn&#039;t tabbed, so even if x is equal to 7, y will still become 3.&lt;br /&gt;
    # If you ever see me use whitespace in this tutorial, make sure you do as well.&lt;br /&gt;
    # Some other useful comparators: != (not equal), &amp;gt;, &amp;gt;= (greater than or equal to), &amp;lt;, &amp;lt;= (less than or equal to), &#039;and&#039;, &#039;or&#039;, &#039;not&#039;&lt;br /&gt;
    # You can add onto the above if-statement by tacking on:&lt;br /&gt;
    elif x == 3:&lt;br /&gt;
        y = 4&lt;br /&gt;
    else:&lt;br /&gt;
        y = 5&lt;br /&gt;
    # With elif meaning &amp;quot;else if&amp;quot; for a second possible condition, and &amp;quot;else&amp;quot; for something that you want to execute if none of the earlier conditions are met.&lt;br /&gt;
&lt;br /&gt;
    # You can also have a loop that executes code for a certain amount of time or based on a certain condition. There are two kinds of loops. The first is a while loop that keeps looping&lt;br /&gt;
    # until the terminating condition is met.&lt;br /&gt;
    while x &amp;lt; 5:&lt;br /&gt;
        print(&amp;quot;x is &amp;quot;, x)&lt;br /&gt;
        x = x + 1&lt;br /&gt;
    # This will output the value of x up until it reaches 4.&lt;br /&gt;
&lt;br /&gt;
    # The second type of loop is a for loop. This type of loop sets the amount of loops the program will run before hand. &lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
Thus concludes our very, very brief foray into Python. That was simply the bare minimum required to understand what will be needed for this class. More concepts will be introduced as needed, whether that be in this tutorial or in a lab. For a more complete understanding of Python, you can look up other Python tutorials elsewhere on the Internet.&lt;br /&gt;
&lt;br /&gt;
==VPython Basics==&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32217</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32217"/>
		<updated>2018-10-26T20:06:21Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* VPython Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
==Python Basics==&lt;br /&gt;
It&#039;s always helpful to have a basic background knowledge of Python before proceeding with the applications more relevant to this course. A useful website for Python syntax is www.stackoverflow.com. &lt;br /&gt;
&lt;br /&gt;
    # Comments start with a number symbol. A comment is writing that does not impact the code in any way. These are essential so that both you, or anyone else doesn&#039;t get lost in the code and can   &lt;br /&gt;
    #easily locate where a bug may be happening. It is encouraged to use these often.&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
    # Math operations are calculated as follows. &lt;br /&gt;
    1 + 1  # -&amp;gt; 2&lt;br /&gt;
    2 - 1  # -&amp;gt; 1&lt;br /&gt;
    3 * 2  # -&amp;gt; 6&lt;br /&gt;
    8 / 4  # -&amp;gt; 4&lt;br /&gt;
    (1 + 3) * 2  # -&amp;gt; 8&lt;br /&gt;
    1 + (3 * 2)  # -&amp;gt; 7&lt;br /&gt;
&lt;br /&gt;
    # When using an exponent, rather than using the normal &amp;quot;^&amp;quot;, be sure to use &amp;quot;**&amp;quot; instead.&lt;br /&gt;
    2 ** 3  # -&amp;gt; 8&lt;br /&gt;
&lt;br /&gt;
    # There&#039;s also various math functions you can use, such as for finding the square root.&lt;br /&gt;
    sqrt(4) # -&amp;gt; 2&lt;br /&gt;
&lt;br /&gt;
    # However, these math operations are useless if we don&#039;t store the values anywhere. A variable can be any combination of letters. Storing values to a variable allows for said value to be accessed  &lt;br /&gt;
    #again in the future very easily.&lt;br /&gt;
    x = 1 + 1&lt;br /&gt;
    # Now if you try to access x in the future, it will have the value of &#039;2&#039;.&lt;br /&gt;
&lt;br /&gt;
    # Printing something writes the input in the shell so that you can see the results of the output. You can print your variables like this:&lt;br /&gt;
    print(x)&lt;br /&gt;
    # You can also add in some text with them like this:&lt;br /&gt;
    print(&amp;quot;The value of x is &amp;quot;, x)&lt;br /&gt;
&lt;br /&gt;
    # Sometimes we only want to execute something based on a certain condition.&lt;br /&gt;
    if x == 2:&lt;br /&gt;
        y = 3&lt;br /&gt;
    # The &#039;==&#039; means that you&#039;re directly comparing two values. If they&#039;re equal, whatever is on the inside of the if-statement will be executed.&lt;br /&gt;
    # Now is a good time to note that whitespace is very important in Python.&lt;br /&gt;
    # &#039;y = 3&#039; will always execute if it isn&#039;t tabbed, so even if x is equal to 7, y will still become 3.&lt;br /&gt;
    # If you ever see me use whitespace in this tutorial, make sure you do as well.&lt;br /&gt;
    # Some other useful comparators: != (not equal), &amp;gt;, &amp;gt;= (greater than or equal to), &amp;lt;, &amp;lt;= (less than or equal to), &#039;and&#039;, &#039;or&#039;, &#039;not&#039;&lt;br /&gt;
    # You can add onto the above if-statement by tacking on:&lt;br /&gt;
    elif x == 3:&lt;br /&gt;
        y = 4&lt;br /&gt;
    else:&lt;br /&gt;
        y = 5&lt;br /&gt;
    # With elif meaning &amp;quot;else if&amp;quot; for a second possible condition, and &amp;quot;else&amp;quot; for something that you want to execute if none of the earlier conditions are met.&lt;br /&gt;
&lt;br /&gt;
    # You can also have a loop that executes code for a certain amount of time or based on a certain condition. There are two kinds of loops. The first is a while loop that keeps looping&lt;br /&gt;
    # until the terminating condition is met.&lt;br /&gt;
    while x &amp;lt; 5:&lt;br /&gt;
        print(&amp;quot;x is &amp;quot;, x)&lt;br /&gt;
        x = x + 1&lt;br /&gt;
    # This will output the value of x up until it reaches 4.&lt;br /&gt;
&lt;br /&gt;
    # The second type of loop is a for loop. This type of loop sets the amount of loops the program will run before hand. &lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
Thus concludes our very, very brief foray into Python. That was simply the bare minimum required to understand what will be needed for this class. More concepts will be introduced as needed, whether that be in this tutorial or in a lab. For a more complete understanding of Python, you can look up other Python tutorials elsewhere on the Internet.&lt;br /&gt;
&lt;br /&gt;
==VPython Basics==&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
     # To begin with, note that every VPython program must begin with these two lines of code:&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
    &lt;br /&gt;
    # The scene, or visual where you see your code occur, has a width and a height. You can alter them, as seen below.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32216</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32216"/>
		<updated>2018-10-26T20:04:28Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Python Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
==Python Basics==&lt;br /&gt;
It&#039;s always helpful to have a basic background knowledge of Python before proceeding with the applications more relevant to this course. A useful website for Python syntax is www.stackoverflow.com. &lt;br /&gt;
&lt;br /&gt;
    # Comments start with a number symbol. A comment is writing that does not impact the code in any way. These are essential so that both you, or anyone else doesn&#039;t get lost in the code and can   &lt;br /&gt;
    #easily locate where a bug may be happening. It is encouraged to use these often.&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
    # Math operations are calculated as follows. &lt;br /&gt;
    1 + 1  # -&amp;gt; 2&lt;br /&gt;
    2 - 1  # -&amp;gt; 1&lt;br /&gt;
    3 * 2  # -&amp;gt; 6&lt;br /&gt;
    8 / 4  # -&amp;gt; 4&lt;br /&gt;
    (1 + 3) * 2  # -&amp;gt; 8&lt;br /&gt;
    1 + (3 * 2)  # -&amp;gt; 7&lt;br /&gt;
&lt;br /&gt;
    # When using an exponent, rather than using the normal &amp;quot;^&amp;quot;, be sure to use &amp;quot;**&amp;quot; instead.&lt;br /&gt;
    2 ** 3  # -&amp;gt; 8&lt;br /&gt;
&lt;br /&gt;
    # There&#039;s also various math functions you can use, such as for finding the square root.&lt;br /&gt;
    sqrt(4) # -&amp;gt; 2&lt;br /&gt;
&lt;br /&gt;
    # However, these math operations are useless if we don&#039;t store the values anywhere. A variable can be any combination of letters. Storing values to a variable allows for said value to be accessed  &lt;br /&gt;
    #again in the future very easily.&lt;br /&gt;
    x = 1 + 1&lt;br /&gt;
    # Now if you try to access x in the future, it will have the value of &#039;2&#039;.&lt;br /&gt;
&lt;br /&gt;
    # Printing something writes the input in the shell so that you can see the results of the output. You can print your variables like this:&lt;br /&gt;
    print(x)&lt;br /&gt;
    # You can also add in some text with them like this:&lt;br /&gt;
    print(&amp;quot;The value of x is &amp;quot;, x)&lt;br /&gt;
&lt;br /&gt;
    # Sometimes we only want to execute something based on a certain condition.&lt;br /&gt;
    if x == 2:&lt;br /&gt;
        y = 3&lt;br /&gt;
    # The &#039;==&#039; means that you&#039;re directly comparing two values. If they&#039;re equal, whatever is on the inside of the if-statement will be executed.&lt;br /&gt;
    # Now is a good time to note that whitespace is very important in Python.&lt;br /&gt;
    # &#039;y = 3&#039; will always execute if it isn&#039;t tabbed, so even if x is equal to 7, y will still become 3.&lt;br /&gt;
    # If you ever see me use whitespace in this tutorial, make sure you do as well.&lt;br /&gt;
    # Some other useful comparators: != (not equal), &amp;gt;, &amp;gt;= (greater than or equal to), &amp;lt;, &amp;lt;= (less than or equal to), &#039;and&#039;, &#039;or&#039;, &#039;not&#039;&lt;br /&gt;
    # You can add onto the above if-statement by tacking on:&lt;br /&gt;
    elif x == 3:&lt;br /&gt;
        y = 4&lt;br /&gt;
    else:&lt;br /&gt;
        y = 5&lt;br /&gt;
    # With elif meaning &amp;quot;else if&amp;quot; for a second possible condition, and &amp;quot;else&amp;quot; for something that you want to execute if none of the earlier conditions are met.&lt;br /&gt;
&lt;br /&gt;
    # You can also have a loop that executes code for a certain amount of time or based on a certain condition. There are two kinds of loops. The first is a while loop that keeps looping&lt;br /&gt;
    # until the terminating condition is met.&lt;br /&gt;
    while x &amp;lt; 5:&lt;br /&gt;
        print(&amp;quot;x is &amp;quot;, x)&lt;br /&gt;
        x = x + 1&lt;br /&gt;
    # This will output the value of x up until it reaches 4.&lt;br /&gt;
&lt;br /&gt;
    # The second type of loop is a for loop. This type of loop sets the amount of loops the program will run before hand. &lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
Thus concludes our very, very brief foray into Python. That was simply the bare minimum required to understand what will be needed for this class. More concepts will be introduced as needed, whether that be in this tutorial or in a lab. For a more complete understanding of Python, you can look up other Python tutorials elsewhere on the Internet.&lt;br /&gt;
&lt;br /&gt;
==VPython Basics==&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
    # The scene has a width and a height; you can set them like so.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32215</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32215"/>
		<updated>2018-10-26T20:01:28Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: /* Downloading vPython */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/]. Although this is useful, keep in mind that not all labs can be completed through GlowScript.&lt;br /&gt;
&lt;br /&gt;
==Python Basics==&lt;br /&gt;
It&#039;s always helpful to have a background knowledge of Python, however basic, before proceeding with the applications more relevant to this course. Almost any question can be answered on websites like www.stackoverflow.com. Resources like this are great if you are trying to self teach yourself, or simply need a quick question answered.&lt;br /&gt;
&lt;br /&gt;
    # Comments start with a number symbol. A comment is writing that does not impact the code in any way. These are essential so that both you, or anyone else doesn&#039;t get lost in the code and can   &lt;br /&gt;
    #easily locate where a bug may be happening. It is encouraged to use these often.&lt;br /&gt;
    # We&#039;re always going to start our programs with the following headers to ensure that math works correctly.&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
&lt;br /&gt;
    # Math works as you would expect.&lt;br /&gt;
    1 + 1  # -&amp;gt; 2&lt;br /&gt;
    2 - 1  # -&amp;gt; 1&lt;br /&gt;
    3 * 2  # -&amp;gt; 6&lt;br /&gt;
    8 / 4  # -&amp;gt; 4&lt;br /&gt;
    (1 + 3) * 2  # -&amp;gt; 8&lt;br /&gt;
    1 + (3 * 2)  # -&amp;gt; 7&lt;br /&gt;
&lt;br /&gt;
    # That is, until you need to do an exponent. Instead of a &amp;quot;^&amp;quot;, you simply do a double asterisk&amp;quot;**&amp;quot;. But you shouldn&#039;t encounter anything much weirder than that math-wise.&lt;br /&gt;
    2 ** 3  # -&amp;gt; 8&lt;br /&gt;
&lt;br /&gt;
    # There&#039;s also various math functions you can use, such as for finding the square root.&lt;br /&gt;
    sqrt(4) # -&amp;gt; 2&lt;br /&gt;
&lt;br /&gt;
    # However, these math operations are useless if we don&#039;t store the values anywhere. A variable can be any combination of letters. Storing values to a variable allows for said value to be accessed  &lt;br /&gt;
    #again in the future very easily.&lt;br /&gt;
    x = 1 + 1&lt;br /&gt;
    # Now if you try to access x in the future, it will have the value of &#039;2&#039;.&lt;br /&gt;
&lt;br /&gt;
    # Printing something writes the input in the shell so that you can see the results of the output. You can print your variables like this:&lt;br /&gt;
    print(x)&lt;br /&gt;
    # You can also add in some text with them like this:&lt;br /&gt;
    print(&amp;quot;The value of x is &amp;quot;, x)&lt;br /&gt;
&lt;br /&gt;
    # Sometimes we only want to execute something based on a certain condition.&lt;br /&gt;
    if x == 2:&lt;br /&gt;
        y = 3&lt;br /&gt;
    # The &#039;==&#039; means that you&#039;re directly comparing two values. If they&#039;re equal, whatever is on the inside of the if-statement will be executed.&lt;br /&gt;
    # Now is a good time to note that whitespace is very important in Python.&lt;br /&gt;
    # &#039;y = 3&#039; will always execute if it isn&#039;t tabbed, so even if x is equal to 7, y will still become 3.&lt;br /&gt;
    # If you ever see me use whitespace in this tutorial, make sure you do as well.&lt;br /&gt;
    # Some other useful comparators: != (not equal), &amp;gt;, &amp;gt;= (greater than or equal to), &amp;lt;, &amp;lt;= (less than or equal to), &#039;and&#039;, &#039;or&#039;, &#039;not&#039;&lt;br /&gt;
    # You can add onto the above if-statement by tacking on:&lt;br /&gt;
    elif x == 3:&lt;br /&gt;
        y = 4&lt;br /&gt;
    else:&lt;br /&gt;
        y = 5&lt;br /&gt;
    # With elif meaning &amp;quot;else if&amp;quot; for a second possible condition, and &amp;quot;else&amp;quot; for something that you want to execute if none of the earlier conditions are met.&lt;br /&gt;
&lt;br /&gt;
    # You can also have a loop that executes code for a certain amount of time or based on a certain condition. There are two kinds of loops. The first is a while loop that keeps looping&lt;br /&gt;
    # until the terminating condition is met.&lt;br /&gt;
    while x &amp;lt; 5:&lt;br /&gt;
        print(&amp;quot;x is &amp;quot;, x)&lt;br /&gt;
        x = x + 1&lt;br /&gt;
    # This will output the value of x up until it reaches 4.&lt;br /&gt;
&lt;br /&gt;
    # The second type of loop is a for loop. This type of loop sets the amount of loops the program will run before hand. &lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
Thus concludes our very, very brief foray into Python. That was simply the bare minimum required to understand what will be needed for this class. More concepts will be introduced as needed, whether that be in this tutorial or in a lab. For a more complete understanding of Python, you can look up other Python tutorials elsewhere on the Internet.&lt;br /&gt;
&lt;br /&gt;
==VPython Basics==&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
    # The scene has a width and a height; you can set them like so.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32214</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=32214"/>
		<updated>2018-10-26T19:57:18Z</updated>

		<summary type="html">&lt;p&gt;Mpowers42: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Claimed by Morgan Powers for Fall 2018&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
VPython is an extension of the Python programming language that contains a 3D graphics module called Visual, which allows users to create simple simulations of physics problems. Its primary use is for educational purposes, although it has been used in research before in the past. Although it is slightly different from the actual Python program, it is similar enough for the purpose of this class. Most of the labs done this year will be done using the vPython program.&lt;br /&gt;
&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
In all cases you will need to have Python 2.7.9 installed. Future versions may also work, but be warned that it may cause VPython to behave erratically.&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_windows.html For Windows]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_mac.html For Mac]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/download_linux.html For Linux]&lt;br /&gt;
&lt;br /&gt;
Note for Linux: You can only install Classic VPython, which is no longer supported and may be missing some features and bug fixes that are present in the current version of VPython.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use GlowScript, a virtual environment that allows you to execute VPython code in your browser. You can create an account at [http://www.glowscript.org/ http://www.glowscript.org/].&lt;br /&gt;
&lt;br /&gt;
==Python Basics==&lt;br /&gt;
It&#039;s always helpful to have a background knowledge of Python, however basic, before proceeding with the applications more relevant to this course. Almost any question can be answered on websites like www.stackoverflow.com. Resources like this are great if you are trying to self teach yourself, or simply need a quick question answered.&lt;br /&gt;
&lt;br /&gt;
    # Comments start with a number symbol. A comment is writing that does not impact the code in any way. These are essential so that both you, or anyone else doesn&#039;t get lost in the code and can   &lt;br /&gt;
    #easily locate where a bug may be happening. It is encouraged to use these often.&lt;br /&gt;
    # We&#039;re always going to start our programs with the following headers to ensure that math works correctly.&lt;br /&gt;
    from__future__ import division&lt;br /&gt;
    from visual import*&lt;br /&gt;
&lt;br /&gt;
    # Math works as you would expect.&lt;br /&gt;
    1 + 1  # -&amp;gt; 2&lt;br /&gt;
    2 - 1  # -&amp;gt; 1&lt;br /&gt;
    3 * 2  # -&amp;gt; 6&lt;br /&gt;
    8 / 4  # -&amp;gt; 4&lt;br /&gt;
    (1 + 3) * 2  # -&amp;gt; 8&lt;br /&gt;
    1 + (3 * 2)  # -&amp;gt; 7&lt;br /&gt;
&lt;br /&gt;
    # That is, until you need to do an exponent. Instead of a &amp;quot;^&amp;quot;, you simply do a double asterisk&amp;quot;**&amp;quot;. But you shouldn&#039;t encounter anything much weirder than that math-wise.&lt;br /&gt;
    2 ** 3  # -&amp;gt; 8&lt;br /&gt;
&lt;br /&gt;
    # There&#039;s also various math functions you can use, such as for finding the square root.&lt;br /&gt;
    sqrt(4) # -&amp;gt; 2&lt;br /&gt;
&lt;br /&gt;
    # However, these math operations are useless if we don&#039;t store the values anywhere. A variable can be any combination of letters. Storing values to a variable allows for said value to be accessed  &lt;br /&gt;
    #again in the future very easily.&lt;br /&gt;
    x = 1 + 1&lt;br /&gt;
    # Now if you try to access x in the future, it will have the value of &#039;2&#039;.&lt;br /&gt;
&lt;br /&gt;
    # Printing something writes the input in the shell so that you can see the results of the output. You can print your variables like this:&lt;br /&gt;
    print(x)&lt;br /&gt;
    # You can also add in some text with them like this:&lt;br /&gt;
    print(&amp;quot;The value of x is &amp;quot;, x)&lt;br /&gt;
&lt;br /&gt;
    # Sometimes we only want to execute something based on a certain condition.&lt;br /&gt;
    if x == 2:&lt;br /&gt;
        y = 3&lt;br /&gt;
    # The &#039;==&#039; means that you&#039;re directly comparing two values. If they&#039;re equal, whatever is on the inside of the if-statement will be executed.&lt;br /&gt;
    # Now is a good time to note that whitespace is very important in Python.&lt;br /&gt;
    # &#039;y = 3&#039; will always execute if it isn&#039;t tabbed, so even if x is equal to 7, y will still become 3.&lt;br /&gt;
    # If you ever see me use whitespace in this tutorial, make sure you do as well.&lt;br /&gt;
    # Some other useful comparators: != (not equal), &amp;gt;, &amp;gt;= (greater than or equal to), &amp;lt;, &amp;lt;= (less than or equal to), &#039;and&#039;, &#039;or&#039;, &#039;not&#039;&lt;br /&gt;
    # You can add onto the above if-statement by tacking on:&lt;br /&gt;
    elif x == 3:&lt;br /&gt;
        y = 4&lt;br /&gt;
    else:&lt;br /&gt;
        y = 5&lt;br /&gt;
    # With elif meaning &amp;quot;else if&amp;quot; for a second possible condition, and &amp;quot;else&amp;quot; for something that you want to execute if none of the earlier conditions are met.&lt;br /&gt;
&lt;br /&gt;
    # You can also have a loop that executes code for a certain amount of time or based on a certain condition. There are two kinds of loops. The first is a while loop that keeps looping&lt;br /&gt;
    # until the terminating condition is met.&lt;br /&gt;
    while x &amp;lt; 5:&lt;br /&gt;
        print(&amp;quot;x is &amp;quot;, x)&lt;br /&gt;
        x = x + 1&lt;br /&gt;
    # This will output the value of x up until it reaches 4.&lt;br /&gt;
&lt;br /&gt;
    # The second type of loop is a for loop. This type of loop sets the amount of loops the program will run before hand. &lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
Thus concludes our very, very brief foray into Python. That was simply the bare minimum required to understand what will be needed for this class. More concepts will be introduced as needed, whether that be in this tutorial or in a lab. For a more complete understanding of Python, you can look up other Python tutorials elsewhere on the Internet.&lt;br /&gt;
&lt;br /&gt;
==VPython Basics==&lt;br /&gt;
&lt;br /&gt;
In this section we will analyze some of the objects utilized by VPython. Each object is more or less self-explanatory with equally clear fields within.&lt;br /&gt;
&lt;br /&gt;
    # The scene has a width and a height; you can set them like so.&lt;br /&gt;
    scene.width = 1024&lt;br /&gt;
    scene.height = 760&lt;br /&gt;
&lt;br /&gt;
    # Beyond that, we have vectors.&lt;br /&gt;
    # You can access each component with pos.x, pos.y, or pos.z depending on which component you want.&lt;br /&gt;
    # Now would be a good time to mention that you access an object&#039;s field with a period following the variable name.&lt;br /&gt;
    pos = vector(1, 2, 3)&lt;br /&gt;
    xComponent = pos.x  #This value would be 1&lt;br /&gt;
    yComponent = pos.y  #This value would be 2&lt;br /&gt;
    zComponent = pos.z. #This value would be 3&lt;br /&gt;
&lt;br /&gt;
    # You can add two or more vectors together and you can multiply a vector by a scalar,&lt;br /&gt;
    # Adding&lt;br /&gt;
    A = vector(1, 2, 3)&lt;br /&gt;
    B = vector(4, 5, 6)&lt;br /&gt;
    C = A + B  # The value of C is now (5, 7, 9)&lt;br /&gt;
    # Multiplying&lt;br /&gt;
    D = 5 * C. # The value of D is now (25, 35, 45)&lt;br /&gt;
    # but you can&#039;t add a scalar to a vector.&lt;br /&gt;
    # To get the magnitude of or to normalize a vector, use the appropriate function.&lt;br /&gt;
    initialPos = vector(10, 3, 0)&lt;br /&gt;
    finalPos = vector(30, 15, 0)&lt;br /&gt;
    deltaR = finalPos - initialPos # -&amp;gt; vector(20, 12, 0)&lt;br /&gt;
    rMag = mag(finalPos)&lt;br /&gt;
    rHat = norm(finalPos)&lt;br /&gt;
    errorDemo = magR + finalPos # -&amp;gt; error; causes your program to crash&lt;br /&gt;
&lt;br /&gt;
    # There are a number of different shapes you can create for visual reference in the vPython program. These will be used quite frequently in lab to observe things like momentum, force, etc.&lt;br /&gt;
&lt;br /&gt;
    # If you were to make, say, a ball, you would want to draw a sphere.&lt;br /&gt;
    # It has a position field, a radius field, and a color field.&lt;br /&gt;
    # When creating a new instance of an object, each field is comma separated.&lt;br /&gt;
    # You access each field the same way as we did with the position vector.&lt;br /&gt;
    ball = sphere(pos = vector(10, 10, 10), radius = 9e2, color = color.red)&lt;br /&gt;
    ballColor = ball.color&lt;br /&gt;
    ballPos = ball.pos&lt;br /&gt;
    ballRadius = ball.radius&lt;br /&gt;
&lt;br /&gt;
    # You can draw arrows.&lt;br /&gt;
    # These also have a color and position field, but instead of a radius, they have an axis that determines their length.&lt;br /&gt;
    # These arrows can be used to represent the magnitude of the force or the momentum or anything else the lab asks you to make. &lt;br /&gt;
    velocityArrow = arrow(color = color.blue, pos = vector(-10, -10, -10), axis = velocity * vScale)&lt;br /&gt;
&lt;br /&gt;
    # There are also boxes.&lt;br /&gt;
    # They have a position vector and a size vector.&lt;br /&gt;
    myBox = box(pos = vector(50, 50, 50), size = vector(20, 15, 12))&lt;br /&gt;
&lt;br /&gt;
    # You can draw helixes, which are useful for depicting springs.&lt;br /&gt;
    # They have a position field, a color field, a thickness field, a radius field, and a field for the number of coils.&lt;br /&gt;
    spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)&lt;br /&gt;
&lt;br /&gt;
    # If you want to trace a moving object, you can have a curve follow it by adding to it every time step. This will show the entire path the object has traveled during the simulation.&lt;br /&gt;
    posTrace = curve(color = color.yellow)&lt;br /&gt;
    trail.append(ball.pos)&lt;br /&gt;
&lt;br /&gt;
    # You also have the option of making graphs as your program progresses; this is particularly useful for potential vs kinetic energy.&lt;br /&gt;
    Kgraph = gcurve(color = color.cyan)&lt;br /&gt;
    Ugraph = gcurve(color = color.yellow)&lt;br /&gt;
    KplusUgraph = gcurve(color = color.red)&lt;br /&gt;
    # For each time step...&lt;br /&gt;
    Kgraph.plot(pos = (t, Kenergy))&lt;br /&gt;
    Ugraph.plot(pos = (t, Uenergy))&lt;br /&gt;
    KplusUgraph.plot(pos = (t, Kenergy + Uenergy))&lt;br /&gt;
&lt;br /&gt;
By updating the fields of whatever objects you decide to use and by using any intermediate variables necessary, you&#039;re able to draw and compute what you&#039;ll need for this course.&lt;/div&gt;</summary>
		<author><name>Mpowers42</name></author>
	</entry>
</feed>