Difference between revisions of "3DGraphsVectorFields"
(added historical tag and gave updated problem link) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{historical}} |
||
+ | |||
+ | <p style="font-size: 120%;font-weight:bold">This problem has been replaced with [https://openwebwork.github.io/pg-docs/sample-problems/VectorCalc/VectorFieldGraph3D/VectorFieldGraph3D1.html a newer version of this problem]</p> |
||
<h2>Vector Fields in Three Dimensions</h2> |
<h2>Vector Fields in Three Dimensions</h2> |
||
Line 86: | Line 89: | ||
</p> |
</p> |
||
<p> |
<p> |
||
− | Setting <code>outputtype</code> to something other than 4 will require you to read the source code of <code>LiveGraphicsVectorField3D.pl</code> and familiarize yourself with the details of the <code>LiveGraphics3D</code> java applet. For more information on how to work with the string of plot data, see [http://www.vis.uni-stuttgart.de/~kraus/LiveGraphics3D/ LiveGraphics3D homepage] and the excellent article by Jonathan Rogness and Martin Kraus [http://mathdl.maa.org/mathDL/55/?pa=content&sa=viewDocument&nodeId=1143&pf=1 Constructing Mathlets Quickly Using LiveGraphics3D] |
+ | Setting <code>outputtype</code> to something other than 4 will require you to read the source code of <code>LiveGraphicsVectorField3D.pl</code> and familiarize yourself with the details of the <code>LiveGraphics3D</code> java applet. For more information on how to work with the string of plot data, see Martin Kraus's [http://www.vis.uni-stuttgart.de/~kraus/LiveGraphics3D/ LiveGraphics3D homepage], and the excellent article by Jonathan Rogness and Martin Kraus [http://mathdl.maa.org/mathDL/55/?pa=content&sa=viewDocument&nodeId=1143&pf=1 Constructing Mathlets Quickly Using LiveGraphics3D]. |
</p> |
</p> |
||
</td> |
</td> |
||
Line 117: | Line 120: | ||
<b>Main Text:</b> |
<b>Main Text:</b> |
||
To display the string of plot data <code>$plot</code>, we use the <code>Live3Ddata()</code> routine provided by the macro <code>LiveGraphics3D.pl</code>, which is automatically loaded by <code>LiveGraphicsVectorField3D.pl</code>. |
To display the string of plot data <code>$plot</code>, we use the <code>Live3Ddata()</code> routine provided by the macro <code>LiveGraphics3D.pl</code>, which is automatically loaded by <code>LiveGraphicsVectorField3D.pl</code>. |
||
+ | </p> |
||
+ | <p> |
||
+ | After you construct the vector field you like, <b>don't forget to take a screen shot of it and make an image file such as <code>cool-vector-field.png</code> that will be used in the pdf hardcopy.</b> |
||
</p> |
</p> |
||
</td> |
</td> |
Latest revision as of 10:07, 29 June 2023
This problem has been replaced with a newer version of this problem
Vector Fields in Three Dimensions
This PG code shows how to display vector fields in three dimensions that are defined by formulas.
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "parserVectorUtils.pl", "PGcourse.pl", "LiveGraphicsVectorField3D.pl", ); TEXT(beginproblem()); |
Initialization:
We need to include the macros file |
Context("Numeric"); Context()->variables->are(x=>"Real",y=>"Real",z=>"Real"); $plot = VectorField3D( Fx => Formula("y"), Fy => Formula("-x"), Fz => Formula("z"), xvar => 'x', yvar => 'y', zvar => 'z', xmin => -1, xmax => 1, ymin => -1, ymax => 1, zmin => -1, zmax => 1, xsamples => 4, ysamples => 4, zsamples => 4, axesframed => 1, xaxislabel => "X", yaxislabel => "Y", zaxislabel => "Z", vectorcolor => "RGBColor[1.0,0.0,0.0]", vectorscale => 0.2, vectorthickness => 0.01, outputtype => 4, ); |
Setup:
The
Setting |
Context()->texStrings; BEGIN_TEXT $BCENTER \{ Live3Ddata( $plot, image => "cool-vector-field.png", size => [400,400], tex_size => 600, tex_center => 1, scale => 1, ); \} $ECENTER END_TEXT Context()->normalStrings; |
Main Text:
To display the string of plot data
After you construct the vector field you like, don't forget to take a screen shot of it and make an image file such as |
$showPartialCorrectAnswers = 1; ENDDOCUMENT(); |
Answer Evaluation: We didn't ask any questions, so this is uninteresting. |