Graph3DCylindrical1: Difference between revisions
Paultpearson (talk | contribs) mNo edit summary |
Paultpearson (talk | contribs) No edit summary |
||
Line 5: | Line 5: | ||
This PG code shows how to make an interactive graph of a function in cylindrical coordinates that is displayed using the LiveGraphics3D Java applet. | This PG code shows how to make an interactive graph of a function in cylindrical coordinates that is displayed using the LiveGraphics3D Java applet. | ||
</p> | </p> | ||
* | * File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/tree/master/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalcMV/Graph3DCylindrical1 FortLewis/Authoring/Templates/DiffCalcMV/Graph3DCylindrical1/Graph3DCylindrical1.pg] | ||
<br clear="all" /> | <br clear="all" /> | ||
Line 154: | Line 153: | ||
Context()->texStrings; | Context()->texStrings; | ||
BEGIN_SOLUTION | BEGIN_SOLUTION | ||
Solution explanation goes here. | Solution explanation goes here. | ||
END_SOLUTION | END_SOLUTION |
Revision as of 21:24, 16 June 2013
Interactive Graphs of Functions in Cylindrical Coordinates

This PG code shows how to make an interactive graph of a function in cylindrical coordinates that is displayed using the LiveGraphics3D Java applet.
- File location in OPL: FortLewis/Authoring/Templates/DiffCalcMV/Graph3DCylindrical1/Graph3DCylindrical1.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "parserVectorUtils.pl", "PGcourse.pl", "LiveGraphicsCylindricalPlot3D.pl", ); TEXT(beginproblem()); |
Initialization:
We need to include the macros file |
Context("Numeric"); Context()->variables->are(x=>"Real",y=>"Real",r=>"Real",t=>"Real"); $a = random(2,4,1); $plot = CylindricalPlot3D( function => Formula("$a*cos((r^2)/4)"), rvar => "r", tvar => "t", rmin => 0, rmax => 6, tmin => 0, tmax => 2*pi, rsamples => 20, tsamples => 15, axesframed => 1, xaxislabel => "X", yaxislabel => "Y", zaxislabel => "Z", outputtype => 4, ); |
Setup:
We generate a string of plot data using
Setting |
Context()->texStrings; BEGIN_TEXT \{ Live3Ddata( $plot, image => "bell-shape.png", size => [400,400], tex_size => 600, tex_center => 1, scale => 1.1, ); \} END_TEXT Context()->normalStrings; |
Main Text:
To display the string of plot data
After you construct the graph you like, don't forget to take a screen shot of it and make an image file such as |
$showPartialCorrectAnswers = 1; |
Answer Evaluation: |
Context()->texStrings; BEGIN_SOLUTION Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT(); |
Solution: |