<?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=Cchoi70</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=Cchoi70"/>
	<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/Special:Contributions/Cchoi70"/>
	<updated>2026-04-11T14:52:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.7</generator>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28551</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28551"/>
		<updated>2017-04-10T01:07:29Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
A disk can be considered as a collection of concentric current loops. &lt;br /&gt;
&lt;br /&gt;
One circular current loop of radius &#039;&#039;R&#039;&#039; and current &#039;&#039;I&#039;&#039; a distance &#039;&#039;z&#039;&#039;; above the center of the loop will produce a magnetic field:&lt;br /&gt;
&lt;br /&gt;
[[File:magfielddisk.png]]&lt;br /&gt;
&lt;br /&gt;
We start with a spinning disk with surface charge density &amp;amp;sigma;. We can treat this as a collection of concentric current loops, with the current at radius &#039;&#039;r&#039;&#039; given by&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(1).png]]&lt;br /&gt;
&lt;br /&gt;
where &amp;amp;omega; is the angular velocity. The field of the spinning disk is then&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(5).png]] = [[File:Latex_(2).png]]&lt;br /&gt;
&lt;br /&gt;
= [[File:Latex_(3).png]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Simple===&lt;br /&gt;
===Middling===&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Magnetic_Field_of_a_Long_Straight_Wire Magnetic Field of a Long Straight Wire]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Magnetic_Field_of_a_Loop Magnetic Field of a Loop]&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28548</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28548"/>
		<updated>2017-04-10T01:07:14Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
A disk can be considered as a collection of concentric current loops. &lt;br /&gt;
&lt;br /&gt;
One circular current loop of radius &#039;&#039;R&#039;&#039; and current &#039;&#039;I&#039;&#039; a distance &#039;&#039;z&#039;&#039;; above the center of the loop will produce a magnetic field:&lt;br /&gt;
&lt;br /&gt;
[[File:magfielddisk.png]]&lt;br /&gt;
&lt;br /&gt;
We start with a spinning disk with surface charge density &amp;amp;sigma;. We can treat this as a collection of concentric current loops, with the current at radius &#039;&#039;r&#039;&#039; given by&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(1).png]]&lt;br /&gt;
&lt;br /&gt;
where &amp;amp;omega; is the angular velocity. The field of the spinning disk is then&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(5).png]] = [[File:Latex_(2).png]]&lt;br /&gt;
&lt;br /&gt;
= [[File:Latex_(3).png]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Simple===&lt;br /&gt;
===Middling===&lt;br /&gt;
===Difficult===&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Magnetic_Field_of_a_Long_Straight_Wire Magnetic Field of a Long Straight Wire]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/Magnetic_Field_of_a_Loop Magnetic Field of a Loop]&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28531</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28531"/>
		<updated>2017-04-10T00:57:08Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: /* A Mathematical Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
A disk can be considered as a collection of concentric current loops. &lt;br /&gt;
&lt;br /&gt;
One circular current loop of radius &#039;&#039;R&#039;&#039; and current &#039;&#039;I&#039;&#039; a distance &#039;&#039;z&#039;&#039;; above the center of the loop will produce a magnetic field:&lt;br /&gt;
&lt;br /&gt;
[[File:magfielddisk.png]]&lt;br /&gt;
&lt;br /&gt;
We start with a spinning disk with surface charge density &amp;amp;sigma;. We can treat this as a collection of concentric current loops, with the current at radius &#039;&#039;r&#039;&#039; given by&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(1).png]]&lt;br /&gt;
&lt;br /&gt;
where &amp;amp;omega; is the angular velocity. The field of the spinning disk is then&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(5).png]] = [[File:Latex_(2).png]]&lt;br /&gt;
&lt;br /&gt;
= [[File:Latex_(3).png]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple===&lt;br /&gt;
===Middling===&lt;br /&gt;
===Difficult===&lt;br /&gt;
==Connectedness==&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
==History==&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28530</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28530"/>
		<updated>2017-04-10T00:56:40Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: /* A Mathematical Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
A disk can be considered as a collection of concentric current loops. &lt;br /&gt;
&lt;br /&gt;
One circular current loop of radius &#039;&#039;R&#039;&#039; and current &#039;&#039;I&#039;&#039; a distance &#039;&#039;z&#039;&#039;; above the center of the loop will produce a magnetic field:&lt;br /&gt;
&lt;br /&gt;
[[File:magfielddisk.png]]&lt;br /&gt;
&lt;br /&gt;
We start with a spinning disk with surface charge density &amp;amp;sigma;. We can treat this as a collection of concentric current loops, with the current at radius &#039;&#039;r&#039;&#039; given by&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(1).png]]&lt;br /&gt;
&lt;br /&gt;
where &amp;amp;omega; is the angular velocity. The field of the spinning disk is then&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(5).png]][[File:Latex_(2).png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(3).png]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple===&lt;br /&gt;
===Middling===&lt;br /&gt;
===Difficult===&lt;br /&gt;
==Connectedness==&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
==History==&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(5).png&amp;diff=28529</id>
		<title>File:Latex (5).png</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(5).png&amp;diff=28529"/>
		<updated>2017-04-10T00:56:22Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28510</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28510"/>
		<updated>2017-04-10T00:45:18Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: /* A Mathematical Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
A disk can be considered as a collection of concentric current loops. &lt;br /&gt;
&lt;br /&gt;
One circular current loop of radius &#039;&#039;R&#039;&#039; and current &#039;&#039;I&#039;&#039; a distance &#039;&#039;z&#039;&#039;; above the center of the loop will produce a magnetic field:&lt;br /&gt;
&lt;br /&gt;
[[File:magfielddisk.png]]&lt;br /&gt;
&lt;br /&gt;
We start with a spinning disk with surface charge density &amp;amp;sigma;. We can treat this as a collection of concentric current loops, with the current at radius &#039;&#039;r&#039;&#039; given by&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(1).png]]&lt;br /&gt;
&lt;br /&gt;
where &amp;amp;omega; is the angular velocity. The field of the spinning disk is then&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(2).png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Latex_(3).png]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple===&lt;br /&gt;
===Middling===&lt;br /&gt;
===Difficult===&lt;br /&gt;
==Connectedness==&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
==History==&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28509</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28509"/>
		<updated>2017-04-10T00:44:47Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
A disk can be considered as a collection of concentric current loops. &lt;br /&gt;
&lt;br /&gt;
One circular current loop of radius &#039;&#039;R&#039;&#039; and current &#039;&#039;I&#039;&#039; a distance &#039;&#039;z&#039;&#039;; above the center of the loop will produce a magnetic field:&lt;br /&gt;
&lt;br /&gt;
[[File:magfielddisk.png]]&lt;br /&gt;
&lt;br /&gt;
We start with a spinning disk with surface charge density &amp;amp;sigma;. We can treat this as a collection of concentric current loops, with the current at radius &#039;&#039;r&#039;&#039; given by&lt;br /&gt;
&lt;br /&gt;
[[File:Latex(1).png]]&lt;br /&gt;
&lt;br /&gt;
where &amp;amp;omega; is the angular velocity. The field of the spinning disk is then&lt;br /&gt;
&lt;br /&gt;
[[File:Latex(2).png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Latex(3).png]]&lt;br /&gt;
==Examples==&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple===&lt;br /&gt;
===Middling===&lt;br /&gt;
===Difficult===&lt;br /&gt;
==Connectedness==&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
==History==&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(4).png&amp;diff=28508</id>
		<title>File:Latex (4).png</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(4).png&amp;diff=28508"/>
		<updated>2017-04-10T00:43:39Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(3).png&amp;diff=28507</id>
		<title>File:Latex (3).png</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(3).png&amp;diff=28507"/>
		<updated>2017-04-10T00:43:31Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(2).png&amp;diff=28506</id>
		<title>File:Latex (2).png</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(2).png&amp;diff=28506"/>
		<updated>2017-04-10T00:43:24Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(1).png&amp;diff=28505</id>
		<title>File:Latex (1).png</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Latex_(1).png&amp;diff=28505"/>
		<updated>2017-04-10T00:43:13Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Magfielddisk.png&amp;diff=28433</id>
		<title>File:Magfielddisk.png</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Magfielddisk.png&amp;diff=28433"/>
		<updated>2017-04-10T00:06:40Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28417</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28417"/>
		<updated>2017-04-10T00:00:39Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
A disk can be considered as a collection of concentric current loops. &lt;br /&gt;
&lt;br /&gt;
One circular current loop of radius &#039;&#039;R&#039;&#039; and current &#039;&#039;I&#039;&#039; a distance &#039;&#039;z&#039;&#039; above the center of the loop will produce a magnetic field:&lt;br /&gt;
[[File:latex.png]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple===&lt;br /&gt;
===Middling===&lt;br /&gt;
===Difficult===&lt;br /&gt;
==Connectedness==&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
==History==&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28369</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=28369"/>
		<updated>2017-04-09T23:45:29Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
What are the mathematical equations that allow us to model this topic. For example dp⃗ dtsystem=F⃗ net&lt;br /&gt;
dp→dtsystem=F→net&lt;br /&gt;
 where p is the momentum of the system and F is the net force from the surroundings.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple===&lt;br /&gt;
===Middling===&lt;br /&gt;
===Difficult===&lt;br /&gt;
==Connectedness==&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
==History==&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=27287</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=27287"/>
		<updated>2017-04-02T21:40:49Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
Template&lt;br /&gt;
Short Description of Topic&lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
===A Mathematical Model===&lt;br /&gt;
What are the mathematical equations that allow us to model this topic. For example dp⃗ dtsystem=F⃗ net&lt;br /&gt;
dp→dtsystem=F→net&lt;br /&gt;
 where p is the momentum of the system and F is the net force from the surroundings.&lt;br /&gt;
&lt;br /&gt;
===A Computational Model===&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here Teach hands-on with GlowScript&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
===Simple===&lt;br /&gt;
===Middling===&lt;br /&gt;
===Difficult===&lt;br /&gt;
==Connectedness==&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
==History==&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
===External links===&lt;br /&gt;
Internet resources on this topic&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=26976</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=26976"/>
		<updated>2017-02-24T23:08:19Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
&lt;br /&gt;
Template&lt;br /&gt;
Short Description of Topic&lt;br /&gt;
&lt;br /&gt;
==Contents [hide]== &lt;br /&gt;
==1 The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
==1.1 A Mathematical Model==&lt;br /&gt;
==2 Examples==&lt;br /&gt;
==2.1 Simple==&lt;br /&gt;
==2.2 Middling==&lt;br /&gt;
==2.3 Difficult==&lt;br /&gt;
==3 Connectedness==&lt;br /&gt;
==4 History==&lt;br /&gt;
==5 See also==&lt;br /&gt;
==5.1 Further reading==&lt;br /&gt;
==5.2 External links==&lt;br /&gt;
==6 References==&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
State, in your own words, the main idea for this topic Electric Field of Capacitor&lt;br /&gt;
&lt;br /&gt;
==A Mathematical Model==&lt;br /&gt;
What are the mathematical equations that allow us to model this topic. For example dp⃗ dtsystem=F⃗ net&lt;br /&gt;
dp→dtsystem=F→net&lt;br /&gt;
 where p is the momentum of the system and F is the net force from the surroundings.&lt;br /&gt;
&lt;br /&gt;
A Computational Model&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here Teach hands-on with GlowScript&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
==Simple==&lt;br /&gt;
==Middling==&lt;br /&gt;
==Difficult==&lt;br /&gt;
==Connectedness==&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
==History==&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
Internet resources on this topic&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=26975</id>
		<title>Magnetic Field of a Disk</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Magnetic_Field_of_a_Disk&amp;diff=26975"/>
		<updated>2017-02-24T23:07:48Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;claimed by Chloe Choi (cchoi70) Spring 2017&lt;br /&gt;
Template&lt;br /&gt;
Short Description of Topic&lt;br /&gt;
&lt;br /&gt;
==Contents [hide]== &lt;br /&gt;
==1 The Main Idea==&lt;br /&gt;
Through this page, you will understand how to solve for the magnetic field produced by a moving charged, circular disk. &lt;br /&gt;
&lt;br /&gt;
First, let us start with the basics. We know that moving charges spread out over the surface of an object will produce a magnetic field. This is similar to the concept of how charges spread out over an object allowed them to produce unique electric fields. &lt;br /&gt;
&lt;br /&gt;
In order to figure out this magnetic field, we will start from the fundamental principles that we have learned already with regards to how magnetic fields are produced. We will then build on that and include the geometry of the object in question, in this a circular disk, in order to solve for the magnetic field produced by this disk.&lt;br /&gt;
&lt;br /&gt;
==1.1 A Mathematical Model==&lt;br /&gt;
==2 Examples==&lt;br /&gt;
==2.1 Simple==&lt;br /&gt;
==2.2 Middling==&lt;br /&gt;
==2.3 Difficult==&lt;br /&gt;
==3 Connectedness==&lt;br /&gt;
==4 History==&lt;br /&gt;
==5 See also==&lt;br /&gt;
==5.1 Further reading==&lt;br /&gt;
==5.2 External links==&lt;br /&gt;
==6 References==&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
State, in your own words, the main idea for this topic Electric Field of Capacitor&lt;br /&gt;
&lt;br /&gt;
==A Mathematical Model==&lt;br /&gt;
What are the mathematical equations that allow us to model this topic. For example dp⃗ dtsystem=F⃗ net&lt;br /&gt;
dp→dtsystem=F→net&lt;br /&gt;
 where p is the momentum of the system and F is the net force from the surroundings.&lt;br /&gt;
&lt;br /&gt;
A Computational Model&lt;br /&gt;
How do we visualize or predict using this topic. Consider embedding some vpython code here Teach hands-on with GlowScript&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Be sure to show all steps in your solution and include diagrams whenever possible&lt;br /&gt;
&lt;br /&gt;
==Simple==&lt;br /&gt;
==Middling==&lt;br /&gt;
==Difficult==&lt;br /&gt;
==Connectedness==&lt;br /&gt;
How is this topic connected to something that you are interested in?&lt;br /&gt;
How is it connected to your major?&lt;br /&gt;
Is there an interesting industrial application?&lt;br /&gt;
==History==&lt;br /&gt;
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
Books, Articles or other print media on this topic&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
Internet resources on this topic&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23998</id>
		<title>VPython Functions</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23998"/>
		<updated>2016-11-25T05:07:26Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: /* mag2(A) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Kevin Randrup&lt;br /&gt;
&lt;br /&gt;
Claimed Chloe Choi&lt;br /&gt;
&lt;br /&gt;
Introduction to functions in Python and applying them to write shorter and more understandable code.&lt;br /&gt;
Assumes that VPython is [http://www.physicsbook.gatech.edu/VPython installed] and you understand the [http://www.physicsbook.gatech.edu/VPython_basics basics] of programming in Python.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
Functions at a high level are used to perform a certain task. Functions can accept a number of inputs (also &amp;quot;arguments&amp;quot; or &amp;quot;parameters&amp;quot;) and can give back 0 or 1 output values. Furthermore, they make code much easier to understand by encapsulating a task in a single line of code instead of being repeated over and over again.&lt;br /&gt;
&lt;br /&gt;
Whenever you type &amp;lt;code&amp;gt;print(5)&amp;lt;/code&amp;gt;, you are calling a function called &amp;lt;code&amp;gt;print&amp;lt;/code&amp;gt; with an argument of &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;. This page will describe the basics of functions and how to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Basic of Functions==&lt;br /&gt;
&lt;br /&gt;
===Basic Python function syntax===&lt;br /&gt;
Functions can be defined with the def keyword followed by the function name and a colon.&lt;br /&gt;
The &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; keyword can be used for a function to &amp;quot;give back&amp;quot; a result.&lt;br /&gt;
&lt;br /&gt;
 def functionName(argumentOne, argumentTwo):&lt;br /&gt;
     functionReturnValue = argumentOne + argumentTwo&lt;br /&gt;
     return functionReturnValue&lt;br /&gt;
&lt;br /&gt;
===Example function===&lt;br /&gt;
&lt;br /&gt;
 # This function adds three numbers together and gives back the result using the return keyword&lt;br /&gt;
 def addNumbers(a, b, c):&lt;br /&gt;
     return a + b + c&lt;br /&gt;
&lt;br /&gt;
===Example use of a function===&lt;br /&gt;
 # Calls the function addNumbers with the arguments 1, 2 and 4&lt;br /&gt;
 result = addNumbers(1, 2, 4)&lt;br /&gt;
&lt;br /&gt;
==Writing your own Functions==&lt;br /&gt;
Writing a function for a task instead of copy and pasting code makes your program much easier to understand and debug. The best way to illustrate this is with an example.&lt;br /&gt;
&lt;br /&gt;
For this example, we will create a function to calculate the electric field created by a point charge.&lt;br /&gt;
&lt;br /&gt;
As a reminder, this is the formula we are modeling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\overrightarrow{E}=\frac{1}{4πε_0}  \frac{q}{|\overrightarrow{r}|^2} \hat r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we ask what do we need to calculate the electric field?&lt;br /&gt;
* &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; - the charge of the source&lt;br /&gt;
* &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; - the distance from the source to the electric field&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; will be the two arguments to our function which will look like this:&lt;br /&gt;
&lt;br /&gt;
 # Calculates the electric field at a given vector away from the charge&lt;br /&gt;
 def electricField(q, r):&lt;br /&gt;
     electricConstant = 9e9 # 1/(4 * π * e0)&lt;br /&gt;
     return electricConstant * q * r.norm() / r.mag2&lt;br /&gt;
&lt;br /&gt;
===Using the function===&lt;br /&gt;
&lt;br /&gt;
We can apply functions to make our code shorter and easier to understand. Here is some example code that we will shorten with functions.&lt;br /&gt;
&lt;br /&gt;
 # Calculate the eletric field in two different places&lt;br /&gt;
 charge = 1.6e-19&lt;br /&gt;
 origin = vector(0,0,0)&lt;br /&gt;
 &lt;br /&gt;
 point1 = vector(-10, 5, 15)&lt;br /&gt;
 point2 = vector(20, -5, 12)&lt;br /&gt;
 &lt;br /&gt;
 field1 = 9e9 * charge * point1.norm() / point1.mag2&lt;br /&gt;
 field2 = 9e9 * charge * point2.norm() / point2.mag2&lt;br /&gt;
&lt;br /&gt;
We can use a function in the last 2 lines to reduce the duplicated code to the following&lt;br /&gt;
&lt;br /&gt;
 field1 = electricField(charge, point1)&lt;br /&gt;
 field2 = electricField(charge, point2)&lt;br /&gt;
&lt;br /&gt;
==Frequently Used Functions==&lt;br /&gt;
&lt;br /&gt;
VPython already has a few predefined functions for your ease. The following functions are available for working with vectors.&lt;br /&gt;
To better illustrate these functions, let&#039;s say we have a vector called exVector.&lt;br /&gt;
&lt;br /&gt;
 exVector = vector(-10, 2 ,5)&lt;br /&gt;
&lt;br /&gt;
===mag()===&lt;br /&gt;
 # Calculates the magnitude of a vector&lt;br /&gt;
 magExVector = mag(exVector)&lt;br /&gt;
 print magExVector    # will print 11.357&lt;br /&gt;
&lt;br /&gt;
===mag2(A)===&lt;br /&gt;
 # Calculates the magnitude squared of a vector&lt;br /&gt;
 mag2ExVector = mag2(exVector)&lt;br /&gt;
 print magExVector     # will print 129&lt;br /&gt;
&lt;br /&gt;
===norm(A)===&lt;br /&gt;
 # Calculates the unit vector of a vector&lt;br /&gt;
 unitExVector = norm(exVector)&lt;br /&gt;
 print unitExVector    # will print &amp;lt;-0.88, 0.17, 0.44&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dot(A, B)===&lt;br /&gt;
 # Calculates the scalar dot product between the two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 dotExVector = dot(exVector, exVector2)&lt;br /&gt;
 print dotExVector     # will print 4&lt;br /&gt;
&lt;br /&gt;
===cross(A, B)===&lt;br /&gt;
 # Calculates the vector cross product between two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 crossExVector = cross(exVector, exVector2)&lt;br /&gt;
 print crossExVector   # will print &amp;lt;26, 100, 12&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython VPython]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_basics VPython Basics]&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Common_Errors_and_Troubleshooting VPython Common Errors and Troubleshooting]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Lists VPython Lists]&lt;br /&gt;
&lt;br /&gt;
[https://docs.python.org/2/library/functions.html Python standard function library].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Modeling with VPython]]&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23997</id>
		<title>VPython Functions</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23997"/>
		<updated>2016-11-25T05:07:16Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: /* cross(A, B) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Kevin Randrup&lt;br /&gt;
&lt;br /&gt;
Claimed Chloe Choi&lt;br /&gt;
&lt;br /&gt;
Introduction to functions in Python and applying them to write shorter and more understandable code.&lt;br /&gt;
Assumes that VPython is [http://www.physicsbook.gatech.edu/VPython installed] and you understand the [http://www.physicsbook.gatech.edu/VPython_basics basics] of programming in Python.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
Functions at a high level are used to perform a certain task. Functions can accept a number of inputs (also &amp;quot;arguments&amp;quot; or &amp;quot;parameters&amp;quot;) and can give back 0 or 1 output values. Furthermore, they make code much easier to understand by encapsulating a task in a single line of code instead of being repeated over and over again.&lt;br /&gt;
&lt;br /&gt;
Whenever you type &amp;lt;code&amp;gt;print(5)&amp;lt;/code&amp;gt;, you are calling a function called &amp;lt;code&amp;gt;print&amp;lt;/code&amp;gt; with an argument of &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;. This page will describe the basics of functions and how to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Basic of Functions==&lt;br /&gt;
&lt;br /&gt;
===Basic Python function syntax===&lt;br /&gt;
Functions can be defined with the def keyword followed by the function name and a colon.&lt;br /&gt;
The &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; keyword can be used for a function to &amp;quot;give back&amp;quot; a result.&lt;br /&gt;
&lt;br /&gt;
 def functionName(argumentOne, argumentTwo):&lt;br /&gt;
     functionReturnValue = argumentOne + argumentTwo&lt;br /&gt;
     return functionReturnValue&lt;br /&gt;
&lt;br /&gt;
===Example function===&lt;br /&gt;
&lt;br /&gt;
 # This function adds three numbers together and gives back the result using the return keyword&lt;br /&gt;
 def addNumbers(a, b, c):&lt;br /&gt;
     return a + b + c&lt;br /&gt;
&lt;br /&gt;
===Example use of a function===&lt;br /&gt;
 # Calls the function addNumbers with the arguments 1, 2 and 4&lt;br /&gt;
 result = addNumbers(1, 2, 4)&lt;br /&gt;
&lt;br /&gt;
==Writing your own Functions==&lt;br /&gt;
Writing a function for a task instead of copy and pasting code makes your program much easier to understand and debug. The best way to illustrate this is with an example.&lt;br /&gt;
&lt;br /&gt;
For this example, we will create a function to calculate the electric field created by a point charge.&lt;br /&gt;
&lt;br /&gt;
As a reminder, this is the formula we are modeling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\overrightarrow{E}=\frac{1}{4πε_0}  \frac{q}{|\overrightarrow{r}|^2} \hat r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we ask what do we need to calculate the electric field?&lt;br /&gt;
* &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; - the charge of the source&lt;br /&gt;
* &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; - the distance from the source to the electric field&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; will be the two arguments to our function which will look like this:&lt;br /&gt;
&lt;br /&gt;
 # Calculates the electric field at a given vector away from the charge&lt;br /&gt;
 def electricField(q, r):&lt;br /&gt;
     electricConstant = 9e9 # 1/(4 * π * e0)&lt;br /&gt;
     return electricConstant * q * r.norm() / r.mag2&lt;br /&gt;
&lt;br /&gt;
===Using the function===&lt;br /&gt;
&lt;br /&gt;
We can apply functions to make our code shorter and easier to understand. Here is some example code that we will shorten with functions.&lt;br /&gt;
&lt;br /&gt;
 # Calculate the eletric field in two different places&lt;br /&gt;
 charge = 1.6e-19&lt;br /&gt;
 origin = vector(0,0,0)&lt;br /&gt;
 &lt;br /&gt;
 point1 = vector(-10, 5, 15)&lt;br /&gt;
 point2 = vector(20, -5, 12)&lt;br /&gt;
 &lt;br /&gt;
 field1 = 9e9 * charge * point1.norm() / point1.mag2&lt;br /&gt;
 field2 = 9e9 * charge * point2.norm() / point2.mag2&lt;br /&gt;
&lt;br /&gt;
We can use a function in the last 2 lines to reduce the duplicated code to the following&lt;br /&gt;
&lt;br /&gt;
 field1 = electricField(charge, point1)&lt;br /&gt;
 field2 = electricField(charge, point2)&lt;br /&gt;
&lt;br /&gt;
==Frequently Used Functions==&lt;br /&gt;
&lt;br /&gt;
VPython already has a few predefined functions for your ease. The following functions are available for working with vectors.&lt;br /&gt;
To better illustrate these functions, let&#039;s say we have a vector called exVector.&lt;br /&gt;
&lt;br /&gt;
 exVector = vector(-10, 2 ,5)&lt;br /&gt;
&lt;br /&gt;
===mag()===&lt;br /&gt;
 # Calculates the magnitude of a vector&lt;br /&gt;
 magExVector = mag(exVector)&lt;br /&gt;
 print magExVector    # will print 11.357&lt;br /&gt;
&lt;br /&gt;
===mag2(A)===&lt;br /&gt;
 # Calculates the magnitude squared of a vector&lt;br /&gt;
 mag2ExVector = mag2(exVector)&lt;br /&gt;
 print magExVector    # will print 129&lt;br /&gt;
&lt;br /&gt;
===norm(A)===&lt;br /&gt;
 # Calculates the unit vector of a vector&lt;br /&gt;
 unitExVector = norm(exVector)&lt;br /&gt;
 print unitExVector    # will print &amp;lt;-0.88, 0.17, 0.44&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dot(A, B)===&lt;br /&gt;
 # Calculates the scalar dot product between the two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 dotExVector = dot(exVector, exVector2)&lt;br /&gt;
 print dotExVector     # will print 4&lt;br /&gt;
&lt;br /&gt;
===cross(A, B)===&lt;br /&gt;
 # Calculates the vector cross product between two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 crossExVector = cross(exVector, exVector2)&lt;br /&gt;
 print crossExVector   # will print &amp;lt;26, 100, 12&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython VPython]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_basics VPython Basics]&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Common_Errors_and_Troubleshooting VPython Common Errors and Troubleshooting]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Lists VPython Lists]&lt;br /&gt;
&lt;br /&gt;
[https://docs.python.org/2/library/functions.html Python standard function library].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Modeling with VPython]]&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23996</id>
		<title>VPython Functions</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23996"/>
		<updated>2016-11-25T05:07:06Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: /* cross(A, B) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Kevin Randrup&lt;br /&gt;
&lt;br /&gt;
Claimed Chloe Choi&lt;br /&gt;
&lt;br /&gt;
Introduction to functions in Python and applying them to write shorter and more understandable code.&lt;br /&gt;
Assumes that VPython is [http://www.physicsbook.gatech.edu/VPython installed] and you understand the [http://www.physicsbook.gatech.edu/VPython_basics basics] of programming in Python.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
Functions at a high level are used to perform a certain task. Functions can accept a number of inputs (also &amp;quot;arguments&amp;quot; or &amp;quot;parameters&amp;quot;) and can give back 0 or 1 output values. Furthermore, they make code much easier to understand by encapsulating a task in a single line of code instead of being repeated over and over again.&lt;br /&gt;
&lt;br /&gt;
Whenever you type &amp;lt;code&amp;gt;print(5)&amp;lt;/code&amp;gt;, you are calling a function called &amp;lt;code&amp;gt;print&amp;lt;/code&amp;gt; with an argument of &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;. This page will describe the basics of functions and how to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Basic of Functions==&lt;br /&gt;
&lt;br /&gt;
===Basic Python function syntax===&lt;br /&gt;
Functions can be defined with the def keyword followed by the function name and a colon.&lt;br /&gt;
The &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; keyword can be used for a function to &amp;quot;give back&amp;quot; a result.&lt;br /&gt;
&lt;br /&gt;
 def functionName(argumentOne, argumentTwo):&lt;br /&gt;
     functionReturnValue = argumentOne + argumentTwo&lt;br /&gt;
     return functionReturnValue&lt;br /&gt;
&lt;br /&gt;
===Example function===&lt;br /&gt;
&lt;br /&gt;
 # This function adds three numbers together and gives back the result using the return keyword&lt;br /&gt;
 def addNumbers(a, b, c):&lt;br /&gt;
     return a + b + c&lt;br /&gt;
&lt;br /&gt;
===Example use of a function===&lt;br /&gt;
 # Calls the function addNumbers with the arguments 1, 2 and 4&lt;br /&gt;
 result = addNumbers(1, 2, 4)&lt;br /&gt;
&lt;br /&gt;
==Writing your own Functions==&lt;br /&gt;
Writing a function for a task instead of copy and pasting code makes your program much easier to understand and debug. The best way to illustrate this is with an example.&lt;br /&gt;
&lt;br /&gt;
For this example, we will create a function to calculate the electric field created by a point charge.&lt;br /&gt;
&lt;br /&gt;
As a reminder, this is the formula we are modeling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\overrightarrow{E}=\frac{1}{4πε_0}  \frac{q}{|\overrightarrow{r}|^2} \hat r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we ask what do we need to calculate the electric field?&lt;br /&gt;
* &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; - the charge of the source&lt;br /&gt;
* &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; - the distance from the source to the electric field&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; will be the two arguments to our function which will look like this:&lt;br /&gt;
&lt;br /&gt;
 # Calculates the electric field at a given vector away from the charge&lt;br /&gt;
 def electricField(q, r):&lt;br /&gt;
     electricConstant = 9e9 # 1/(4 * π * e0)&lt;br /&gt;
     return electricConstant * q * r.norm() / r.mag2&lt;br /&gt;
&lt;br /&gt;
===Using the function===&lt;br /&gt;
&lt;br /&gt;
We can apply functions to make our code shorter and easier to understand. Here is some example code that we will shorten with functions.&lt;br /&gt;
&lt;br /&gt;
 # Calculate the eletric field in two different places&lt;br /&gt;
 charge = 1.6e-19&lt;br /&gt;
 origin = vector(0,0,0)&lt;br /&gt;
 &lt;br /&gt;
 point1 = vector(-10, 5, 15)&lt;br /&gt;
 point2 = vector(20, -5, 12)&lt;br /&gt;
 &lt;br /&gt;
 field1 = 9e9 * charge * point1.norm() / point1.mag2&lt;br /&gt;
 field2 = 9e9 * charge * point2.norm() / point2.mag2&lt;br /&gt;
&lt;br /&gt;
We can use a function in the last 2 lines to reduce the duplicated code to the following&lt;br /&gt;
&lt;br /&gt;
 field1 = electricField(charge, point1)&lt;br /&gt;
 field2 = electricField(charge, point2)&lt;br /&gt;
&lt;br /&gt;
==Frequently Used Functions==&lt;br /&gt;
&lt;br /&gt;
VPython already has a few predefined functions for your ease. The following functions are available for working with vectors.&lt;br /&gt;
To better illustrate these functions, let&#039;s say we have a vector called exVector.&lt;br /&gt;
&lt;br /&gt;
 exVector = vector(-10, 2 ,5)&lt;br /&gt;
&lt;br /&gt;
===mag()===&lt;br /&gt;
 # Calculates the magnitude of a vector&lt;br /&gt;
 magExVector = mag(exVector)&lt;br /&gt;
 print magExVector    # will print 11.357&lt;br /&gt;
&lt;br /&gt;
===mag2(A)===&lt;br /&gt;
 # Calculates the magnitude squared of a vector&lt;br /&gt;
 mag2ExVector = mag2(exVector)&lt;br /&gt;
 print magExVector    # will print 129&lt;br /&gt;
&lt;br /&gt;
===norm(A)===&lt;br /&gt;
 # Calculates the unit vector of a vector&lt;br /&gt;
 unitExVector = norm(exVector)&lt;br /&gt;
 print unitExVector    # will print &amp;lt;-0.88, 0.17, 0.44&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dot(A, B)===&lt;br /&gt;
 # Calculates the scalar dot product between the two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 dotExVector = dot(exVector, exVector2)&lt;br /&gt;
 print dotExVector     # will print 4&lt;br /&gt;
&lt;br /&gt;
===cross(A, B)===&lt;br /&gt;
 # Calculates the vector cross product between two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 crossExVector = cross(exVector, exVector2)&lt;br /&gt;
 print crossExVector    # will print &amp;lt;26, 100, 12&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython VPython]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_basics VPython Basics]&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Common_Errors_and_Troubleshooting VPython Common Errors and Troubleshooting]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Lists VPython Lists]&lt;br /&gt;
&lt;br /&gt;
[https://docs.python.org/2/library/functions.html Python standard function library].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Modeling with VPython]]&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23995</id>
		<title>VPython Functions</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23995"/>
		<updated>2016-11-25T05:06:55Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: /* cross(A, B) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Kevin Randrup&lt;br /&gt;
&lt;br /&gt;
Claimed Chloe Choi&lt;br /&gt;
&lt;br /&gt;
Introduction to functions in Python and applying them to write shorter and more understandable code.&lt;br /&gt;
Assumes that VPython is [http://www.physicsbook.gatech.edu/VPython installed] and you understand the [http://www.physicsbook.gatech.edu/VPython_basics basics] of programming in Python.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
Functions at a high level are used to perform a certain task. Functions can accept a number of inputs (also &amp;quot;arguments&amp;quot; or &amp;quot;parameters&amp;quot;) and can give back 0 or 1 output values. Furthermore, they make code much easier to understand by encapsulating a task in a single line of code instead of being repeated over and over again.&lt;br /&gt;
&lt;br /&gt;
Whenever you type &amp;lt;code&amp;gt;print(5)&amp;lt;/code&amp;gt;, you are calling a function called &amp;lt;code&amp;gt;print&amp;lt;/code&amp;gt; with an argument of &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;. This page will describe the basics of functions and how to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Basic of Functions==&lt;br /&gt;
&lt;br /&gt;
===Basic Python function syntax===&lt;br /&gt;
Functions can be defined with the def keyword followed by the function name and a colon.&lt;br /&gt;
The &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; keyword can be used for a function to &amp;quot;give back&amp;quot; a result.&lt;br /&gt;
&lt;br /&gt;
 def functionName(argumentOne, argumentTwo):&lt;br /&gt;
     functionReturnValue = argumentOne + argumentTwo&lt;br /&gt;
     return functionReturnValue&lt;br /&gt;
&lt;br /&gt;
===Example function===&lt;br /&gt;
&lt;br /&gt;
 # This function adds three numbers together and gives back the result using the return keyword&lt;br /&gt;
 def addNumbers(a, b, c):&lt;br /&gt;
     return a + b + c&lt;br /&gt;
&lt;br /&gt;
===Example use of a function===&lt;br /&gt;
 # Calls the function addNumbers with the arguments 1, 2 and 4&lt;br /&gt;
 result = addNumbers(1, 2, 4)&lt;br /&gt;
&lt;br /&gt;
==Writing your own Functions==&lt;br /&gt;
Writing a function for a task instead of copy and pasting code makes your program much easier to understand and debug. The best way to illustrate this is with an example.&lt;br /&gt;
&lt;br /&gt;
For this example, we will create a function to calculate the electric field created by a point charge.&lt;br /&gt;
&lt;br /&gt;
As a reminder, this is the formula we are modeling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\overrightarrow{E}=\frac{1}{4πε_0}  \frac{q}{|\overrightarrow{r}|^2} \hat r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we ask what do we need to calculate the electric field?&lt;br /&gt;
* &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; - the charge of the source&lt;br /&gt;
* &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; - the distance from the source to the electric field&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; will be the two arguments to our function which will look like this:&lt;br /&gt;
&lt;br /&gt;
 # Calculates the electric field at a given vector away from the charge&lt;br /&gt;
 def electricField(q, r):&lt;br /&gt;
     electricConstant = 9e9 # 1/(4 * π * e0)&lt;br /&gt;
     return electricConstant * q * r.norm() / r.mag2&lt;br /&gt;
&lt;br /&gt;
===Using the function===&lt;br /&gt;
&lt;br /&gt;
We can apply functions to make our code shorter and easier to understand. Here is some example code that we will shorten with functions.&lt;br /&gt;
&lt;br /&gt;
 # Calculate the eletric field in two different places&lt;br /&gt;
 charge = 1.6e-19&lt;br /&gt;
 origin = vector(0,0,0)&lt;br /&gt;
 &lt;br /&gt;
 point1 = vector(-10, 5, 15)&lt;br /&gt;
 point2 = vector(20, -5, 12)&lt;br /&gt;
 &lt;br /&gt;
 field1 = 9e9 * charge * point1.norm() / point1.mag2&lt;br /&gt;
 field2 = 9e9 * charge * point2.norm() / point2.mag2&lt;br /&gt;
&lt;br /&gt;
We can use a function in the last 2 lines to reduce the duplicated code to the following&lt;br /&gt;
&lt;br /&gt;
 field1 = electricField(charge, point1)&lt;br /&gt;
 field2 = electricField(charge, point2)&lt;br /&gt;
&lt;br /&gt;
==Frequently Used Functions==&lt;br /&gt;
&lt;br /&gt;
VPython already has a few predefined functions for your ease. The following functions are available for working with vectors.&lt;br /&gt;
To better illustrate these functions, let&#039;s say we have a vector called exVector.&lt;br /&gt;
&lt;br /&gt;
 exVector = vector(-10, 2 ,5)&lt;br /&gt;
&lt;br /&gt;
===mag()===&lt;br /&gt;
 # Calculates the magnitude of a vector&lt;br /&gt;
 magExVector = mag(exVector)&lt;br /&gt;
 print magExVector    # will print 11.357&lt;br /&gt;
&lt;br /&gt;
===mag2(A)===&lt;br /&gt;
 # Calculates the magnitude squared of a vector&lt;br /&gt;
 mag2ExVector = mag2(exVector)&lt;br /&gt;
 print magExVector    # will print 129&lt;br /&gt;
&lt;br /&gt;
===norm(A)===&lt;br /&gt;
 # Calculates the unit vector of a vector&lt;br /&gt;
 unitExVector = norm(exVector)&lt;br /&gt;
 print unitExVector    # will print &amp;lt;-0.88, 0.17, 0.44&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dot(A, B)===&lt;br /&gt;
 # Calculates the scalar dot product between the two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 dotExVector = dot(exVector, exVector2)&lt;br /&gt;
 print dotExVector     # will print 4&lt;br /&gt;
&lt;br /&gt;
===cross(A, B)===&lt;br /&gt;
 # Calculates the vector cross product between two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 crossExVector = cross(exVector, exVector2)&lt;br /&gt;
 print crossExVector     # will print &amp;lt;26, 100, 12&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython VPython]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_basics VPython Basics]&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Common_Errors_and_Troubleshooting VPython Common Errors and Troubleshooting]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Lists VPython Lists]&lt;br /&gt;
&lt;br /&gt;
[https://docs.python.org/2/library/functions.html Python standard function library].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Modeling with VPython]]&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23994</id>
		<title>VPython Functions</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23994"/>
		<updated>2016-11-25T05:06:35Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Kevin Randrup&lt;br /&gt;
&lt;br /&gt;
Claimed Chloe Choi&lt;br /&gt;
&lt;br /&gt;
Introduction to functions in Python and applying them to write shorter and more understandable code.&lt;br /&gt;
Assumes that VPython is [http://www.physicsbook.gatech.edu/VPython installed] and you understand the [http://www.physicsbook.gatech.edu/VPython_basics basics] of programming in Python.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
Functions at a high level are used to perform a certain task. Functions can accept a number of inputs (also &amp;quot;arguments&amp;quot; or &amp;quot;parameters&amp;quot;) and can give back 0 or 1 output values. Furthermore, they make code much easier to understand by encapsulating a task in a single line of code instead of being repeated over and over again.&lt;br /&gt;
&lt;br /&gt;
Whenever you type &amp;lt;code&amp;gt;print(5)&amp;lt;/code&amp;gt;, you are calling a function called &amp;lt;code&amp;gt;print&amp;lt;/code&amp;gt; with an argument of &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;. This page will describe the basics of functions and how to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Basic of Functions==&lt;br /&gt;
&lt;br /&gt;
===Basic Python function syntax===&lt;br /&gt;
Functions can be defined with the def keyword followed by the function name and a colon.&lt;br /&gt;
The &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; keyword can be used for a function to &amp;quot;give back&amp;quot; a result.&lt;br /&gt;
&lt;br /&gt;
 def functionName(argumentOne, argumentTwo):&lt;br /&gt;
     functionReturnValue = argumentOne + argumentTwo&lt;br /&gt;
     return functionReturnValue&lt;br /&gt;
&lt;br /&gt;
===Example function===&lt;br /&gt;
&lt;br /&gt;
 # This function adds three numbers together and gives back the result using the return keyword&lt;br /&gt;
 def addNumbers(a, b, c):&lt;br /&gt;
     return a + b + c&lt;br /&gt;
&lt;br /&gt;
===Example use of a function===&lt;br /&gt;
 # Calls the function addNumbers with the arguments 1, 2 and 4&lt;br /&gt;
 result = addNumbers(1, 2, 4)&lt;br /&gt;
&lt;br /&gt;
==Writing your own Functions==&lt;br /&gt;
Writing a function for a task instead of copy and pasting code makes your program much easier to understand and debug. The best way to illustrate this is with an example.&lt;br /&gt;
&lt;br /&gt;
For this example, we will create a function to calculate the electric field created by a point charge.&lt;br /&gt;
&lt;br /&gt;
As a reminder, this is the formula we are modeling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\overrightarrow{E}=\frac{1}{4πε_0}  \frac{q}{|\overrightarrow{r}|^2} \hat r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we ask what do we need to calculate the electric field?&lt;br /&gt;
* &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; - the charge of the source&lt;br /&gt;
* &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; - the distance from the source to the electric field&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; will be the two arguments to our function which will look like this:&lt;br /&gt;
&lt;br /&gt;
 # Calculates the electric field at a given vector away from the charge&lt;br /&gt;
 def electricField(q, r):&lt;br /&gt;
     electricConstant = 9e9 # 1/(4 * π * e0)&lt;br /&gt;
     return electricConstant * q * r.norm() / r.mag2&lt;br /&gt;
&lt;br /&gt;
===Using the function===&lt;br /&gt;
&lt;br /&gt;
We can apply functions to make our code shorter and easier to understand. Here is some example code that we will shorten with functions.&lt;br /&gt;
&lt;br /&gt;
 # Calculate the eletric field in two different places&lt;br /&gt;
 charge = 1.6e-19&lt;br /&gt;
 origin = vector(0,0,0)&lt;br /&gt;
 &lt;br /&gt;
 point1 = vector(-10, 5, 15)&lt;br /&gt;
 point2 = vector(20, -5, 12)&lt;br /&gt;
 &lt;br /&gt;
 field1 = 9e9 * charge * point1.norm() / point1.mag2&lt;br /&gt;
 field2 = 9e9 * charge * point2.norm() / point2.mag2&lt;br /&gt;
&lt;br /&gt;
We can use a function in the last 2 lines to reduce the duplicated code to the following&lt;br /&gt;
&lt;br /&gt;
 field1 = electricField(charge, point1)&lt;br /&gt;
 field2 = electricField(charge, point2)&lt;br /&gt;
&lt;br /&gt;
==Frequently Used Functions==&lt;br /&gt;
&lt;br /&gt;
VPython already has a few predefined functions for your ease. The following functions are available for working with vectors.&lt;br /&gt;
To better illustrate these functions, let&#039;s say we have a vector called exVector.&lt;br /&gt;
&lt;br /&gt;
 exVector = vector(-10, 2 ,5)&lt;br /&gt;
&lt;br /&gt;
===mag()===&lt;br /&gt;
 # Calculates the magnitude of a vector&lt;br /&gt;
 magExVector = mag(exVector)&lt;br /&gt;
 print magExVector    # will print 11.357&lt;br /&gt;
&lt;br /&gt;
===mag2(A)===&lt;br /&gt;
 # Calculates the magnitude squared of a vector&lt;br /&gt;
 mag2ExVector = mag2(exVector)&lt;br /&gt;
 print magExVector    # will print 129&lt;br /&gt;
&lt;br /&gt;
===norm(A)===&lt;br /&gt;
 # Calculates the unit vector of a vector&lt;br /&gt;
 unitExVector = norm(exVector)&lt;br /&gt;
 print unitExVector    # will print &amp;lt;-0.88, 0.17, 0.44&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===dot(A, B)===&lt;br /&gt;
 # Calculates the scalar dot product between the two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 dotExVector = dot(exVector, exVector2)&lt;br /&gt;
 print dotExVector     # will print 4&lt;br /&gt;
&lt;br /&gt;
===cross(A, B)===&lt;br /&gt;
 #Calculates the vector cross product between two vectors&lt;br /&gt;
 # exVector2 = vector(4, -2 ,8)&lt;br /&gt;
 crossExVector = cross(exVector, exVector2)&lt;br /&gt;
 print crossExVector     # will print &amp;lt;26, 100, 12&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython VPython]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_basics VPython Basics]&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Common_Errors_and_Troubleshooting VPython Common Errors and Troubleshooting]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Lists VPython Lists]&lt;br /&gt;
&lt;br /&gt;
[https://docs.python.org/2/library/functions.html Python standard function library].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Modeling with VPython]]&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23662</id>
		<title>VPython Functions</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_Functions&amp;diff=23662"/>
		<updated>2016-11-17T18:10:18Z</updated>

		<summary type="html">&lt;p&gt;Cchoi70: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Written by Kevin Randrup&lt;br /&gt;
&lt;br /&gt;
Claimed Chloe Choi&lt;br /&gt;
&lt;br /&gt;
Introduction to functions in Python and applying them to write shorter and more understandable code.&lt;br /&gt;
Assumes that VPython is [http://www.physicsbook.gatech.edu/VPython installed] and you understand the [http://www.physicsbook.gatech.edu/VPython_basics basics] of programming in Python.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
Functions at a high level are used to perform a certain task. Functions can accept a number of inputs (also &amp;quot;arguments&amp;quot; or &amp;quot;parameters&amp;quot;) and can give back 0 or 1 output values. Furthermore, they make code much easier to understand by encapsulating a task in a single line of code instead of being repeated over and over again.&lt;br /&gt;
&lt;br /&gt;
Whenever you type &amp;lt;code&amp;gt;print(5)&amp;lt;/code&amp;gt;, you are calling a function called &amp;lt;code&amp;gt;print&amp;lt;/code&amp;gt; with an argument of &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;. This page will describe the basics of functions and how to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Basic of Functions==&lt;br /&gt;
&lt;br /&gt;
===Basic Python function syntax===&lt;br /&gt;
Functions can be defined with the def keyword followed by the function name and a colon.&lt;br /&gt;
The &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; keyword can be used for a function to &amp;quot;give back&amp;quot; a result.&lt;br /&gt;
&lt;br /&gt;
 def functionName(argumentOne, argumentTwo):&lt;br /&gt;
     functionReturnValue = argumentOne + argumentTwo&lt;br /&gt;
     return functionReturnValue&lt;br /&gt;
&lt;br /&gt;
===Example function===&lt;br /&gt;
&lt;br /&gt;
 # This function adds three numbers together and gives back the result using the return keyword&lt;br /&gt;
 def addNumbers(a, b, c):&lt;br /&gt;
     return a + b + c&lt;br /&gt;
&lt;br /&gt;
===Example use of a function===&lt;br /&gt;
 # Calls the function addNumbers with the arguments 1, 2 and 4&lt;br /&gt;
 result = addNumbers(1, 2, 4)&lt;br /&gt;
&lt;br /&gt;
==Writing your own Functions==&lt;br /&gt;
Writing a function for a task instead of copy and pasting code makes your program much easier to understand and debug. The best way to illustrate this is with an example.&lt;br /&gt;
&lt;br /&gt;
For this example, we will create a function to calculate the electric field created by a point charge.&lt;br /&gt;
&lt;br /&gt;
As a reminder, this is the formula we are modeling:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\overrightarrow{E}=\frac{1}{4πε_0}  \frac{q}{|\overrightarrow{r}|^2} \hat r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we ask what do we need to calculate the electric field?&lt;br /&gt;
* &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; - the charge of the source&lt;br /&gt;
* &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; - the distance from the source to the electric field&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\overrightarrow{r}&amp;lt;/math&amp;gt; will be the two arguments to our function which will look like this:&lt;br /&gt;
&lt;br /&gt;
 # Calculates the electric field at a given vector away from the charge&lt;br /&gt;
 def electricField(q, r):&lt;br /&gt;
     electricConstant = 9e9 # 1/(4 * π * e0)&lt;br /&gt;
     return electricConstant * q * r.norm() / r.mag2&lt;br /&gt;
&lt;br /&gt;
===Using the function===&lt;br /&gt;
&lt;br /&gt;
We can apply functions to make our code shorter and easier to understand. Here is some example code that we will shorten with functions.&lt;br /&gt;
&lt;br /&gt;
 # Calculate the eletric field in two different places&lt;br /&gt;
 charge = 1.6e-19&lt;br /&gt;
 origin = vector(0,0,0)&lt;br /&gt;
 &lt;br /&gt;
 point1 = vector(-10, 5, 15)&lt;br /&gt;
 point2 = vector(20, -5, 12)&lt;br /&gt;
 &lt;br /&gt;
 field1 = 9e9 * charge * point1.norm() / point1.mag2&lt;br /&gt;
 field2 = 9e9 * charge * point2.norm() / point2.mag2&lt;br /&gt;
&lt;br /&gt;
We can use a function in the last 2 lines to reduce the duplicated code to the following&lt;br /&gt;
&lt;br /&gt;
 field1 = electricField(charge, point1)&lt;br /&gt;
 field2 = electricField(charge, point2)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython VPython]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_basics VPython Basics]&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Common_Errors_and_Troubleshooting VPython Common Errors and Troubleshooting]&lt;br /&gt;
&lt;br /&gt;
[http://www.physicsbook.gatech.edu/VPython_Lists VPython Lists]&lt;br /&gt;
&lt;br /&gt;
[https://docs.python.org/2/library/functions.html Python standard function library].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Modeling with VPython]]&lt;/div&gt;</summary>
		<author><name>Cchoi70</name></author>
	</entry>
</feed>