<?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=Lxiao43</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=Lxiao43"/>
	<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/Special:Contributions/Lxiao43"/>
	<updated>2026-05-01T02:07:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.7</generator>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=VPython_3D_Objects&amp;diff=23527</id>
		<title>VPython 3D Objects</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=VPython_3D_Objects&amp;diff=23527"/>
		<updated>2016-11-14T03:48:25Z</updated>

		<summary type="html">&lt;p&gt;Lxiao43: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Claimed by Laurie Xiao&lt;br /&gt;
The VPython programming language contains a number of 3-dimensional objects that can be displayed in a 3D graphics module called Visual.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
VPython is packaged with a variety of 3-Dimensional objects. These objects include:&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/arrow.html Arrow]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/box.html Box]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/cone.html Cone]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/convex.html Convex]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/curve.html Curve]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/cylinder.html Cylinder]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/ellipsoid.html Ellipsoid]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/extrusion.html Extrusion]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/faces.html Faces]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/helix.html Helix]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/label.html Label]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/points.html Points]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/pyramid.html Pyramid]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/ring.html Ring]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/sphere.html Sphere]&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/text.html Text]&lt;br /&gt;
The ease with which these objects can be manipulated using python makes them popular in physics classes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Important Objects==&lt;br /&gt;
The following objects appear often in Physics 2.&lt;br /&gt;
&lt;br /&gt;
===Sphere===&lt;br /&gt;
The sphere object can be used to represent a wide variety of things, but perhaps the most important for use in Physics 2 is point charges and protons/electrons. Two things must be set; the position, a vector; and the radius, a numerical value.&lt;br /&gt;
&lt;br /&gt;
===Arrow===&lt;br /&gt;
The arrow is perhaps the most important object for Physics 2. It can be used to represent Electric and magnetic fields as well as visualizing vectors. To create an arrow the position (a vector), axis (a vector), and the shaftwidth (a numerical value) must be set. &lt;br /&gt;
&lt;br /&gt;
==Object Uses==&lt;br /&gt;
&lt;br /&gt;
===Examples of Simple Objects===&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:sphere1 = sphere(pos=vector(4,8,15), radius=16)&lt;br /&gt;
:&lt;br /&gt;
:arrow1 = arrow(pos=vector(4,8,15), axis=vector(16,23,42)&lt;br /&gt;
:&lt;br /&gt;
:helix1 = helix(pos=vector(4,8,15), axis=vector(16,23,42) radius=.23)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modeling Fields===&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
:from visual import *&lt;br /&gt;
:mzofp = 1e-7&lt;br /&gt;
:oofpez = 9e9&lt;br /&gt;
:qe = 1.6e-19&lt;br /&gt;
:&lt;br /&gt;
:proton = sphere(pos=vector(3e-10,0,0), radius=1e-11, color=color.red)&lt;br /&gt;
:velocity = vector(-5.2e4,0,0) #The proton&#039;s velocity&lt;br /&gt;
:r_obs = vector(0,8e-11,0) #The observation location&lt;br /&gt;
:deltat = 1e-19 #Timestep&lt;br /&gt;
:&lt;br /&gt;
:while proton.x &amp;lt; 5e-10:&lt;br /&gt;
::    r = r_obs - proton.pos &lt;br /&gt;
::    rhat = r/mag(r)&lt;br /&gt;
::    Efield = oofpez*qe*rhat/(mag(r)**2)&lt;br /&gt;
::    Bfield = mzofp*qe*cross(velocity,that)/(mag(r)**2)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
#[http://www.physicsbook.gatech.edu/VPython_basics VPython Basics]&lt;br /&gt;
#[http://www.physicsbook.gatech.edu/VPython VPython]&lt;br /&gt;
#[http://www.physicsbook.gatech.edu/VPython_Animation VPython Animation]&lt;br /&gt;
&lt;br /&gt;
===Further reading===&lt;br /&gt;
&lt;br /&gt;
#[http://www.glowscript.org/docs/VPythonDocs/primitives.html 3D object details]&lt;br /&gt;
#[http://vpython.org VPython Information]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
http://www.glowscript.org/docs/VPythonDocs/primitives.html&lt;br /&gt;
http://vpython.org/contents/docs/shapes.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Modeling With VPython]]&lt;/div&gt;</summary>
		<author><name>Lxiao43</name></author>
	</entry>
</feed>