Difference between revisions of "Graph3DCylindrical1"

From WeBWorK_wiki
Jump to navigation Jump to search
m
(add historical tag and give links to newer problems.)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<h2>Interactive Graphs of Functions in Cylindrical Coordinates</h2>
 
  +
{{historical}}
  +
  +
<p style="font-size: 120%;font-weight:bold">This problem has been replaced with [https://openwebwork.github.io/pg-docs/sample-problems/VectorCalc/CylindricalGraph3D.html a newer version of this problem]</p>
  +
  +
<h2>Deprecated: Interactive Graphs of Functions in Cylindrical Coordinates</h2>
   
 
[[File:Graph3DCylindrical1.png|300px|thumb|right|Click to enlarge]]
 
[[File:Graph3DCylindrical1.png|300px|thumb|right|Click to enlarge]]
 
<p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;">
 
<p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;">
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. It is deprecated because Java is no longer universally supported on all web browsers and platforms.
 
</p>
 
</p>
* Download file: [[File:Graph3DCylindrical1.txt]] (change the file extension from txt to pg when you save it)
 
  +
* 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]
* File location in NPL: <code>FortLewis/Authoring/Templates/DiffCalcMV/Graph3DCylindrical1/Graph3DCylindrical1.pg</code>
 
   
 
<br clear="all" />
 
<br clear="all" />
Line 154: Line 157:
 
Context()->texStrings;
 
Context()->texStrings;
 
BEGIN_SOLUTION
 
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
 
 
Solution explanation goes here.
 
Solution explanation goes here.
 
END_SOLUTION
 
END_SOLUTION

Latest revision as of 06:33, 18 July 2023

This article has been retained as a historical document. It is not up-to-date and the formatting may be lacking. Use the information herein with caution.

This problem has been replaced with a newer version of this problem

Deprecated: Interactive Graphs of Functions in Cylindrical Coordinates

Click to enlarge

This PG code shows how to make an interactive graph of a function in cylindrical coordinates that is displayed using the LiveGraphics3D Java applet. It is deprecated because Java is no longer universally supported on all web browsers and platforms.


Templates by Subject Area

PG problem file Explanation

Problem tagging data

Problem tagging:

DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"parserVectorUtils.pl",
"PGcourse.pl",
"LiveGraphicsCylindricalPlot3D.pl",
);

TEXT(beginproblem());

Initialization: We need to include the macros file LiveGraphicsCylindricalPlot3D.pl.

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 CylindricalPlot3D().

Setting outputtype to something other than 4 will require you to read the source code of LiveGraphicsCylindricalPlot3D.pl and familiarize yourself with the details of the LiveGraphics3D java applet. For more information on how to work with the string of plot data, see Martin Kraus's LiveGraphics3D homepage, and the excellent article by Jonathan Rogness and Martin Kraus Constructing Mathlets Quickly Using LiveGraphics3D.

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 $plot, we use the Live3Ddata() routine provided by the macro LiveGraphics3D.pl, which is loaded automatically.

After you construct the graph you like, don't forget to take a screen shot of it and make an image file such as bell-shape.png that will be used in the pdf hardcopy.

$showPartialCorrectAnswers = 1;

Answer Evaluation:

Context()->texStrings;
BEGIN_SOLUTION
Solution explanation goes here.
END_SOLUTION
Context()->normalStrings;

COMMENT('MathObject version.');

ENDDOCUMENT();

Solution:

Templates by Subject Area