Difference between revisions of "SurfaceGraph1"

From WeBWorK_wiki
Jump to navigation Jump to search
(Created page with '<h2>Graphing a Parametric Surface in 3D</h2> 300px|thumb|right|Click to enlarge <p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;…')
 
m (Deprecate examples using LiveGraphics3D)
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<h2>Graphing a Parametric Surface in 3D</h2>
+
<h2>Deprecated: Graphing a Parametric Surface in 3D</h2>
   
 
[[File:SurfaceGraph1.png|300px|thumb|right|Click to enlarge]]
 
[[File:SurfaceGraph1.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 parametric surface that is displayed using the LiveGraphics3D Java applet.
+
This PG code shows how to make an interactive graph of a parametric surface 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:SurfaceGraph1.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/Parametric/SurfaceGraph1 FortLewis/Authoring/Templates/Parametric/SurfaceGraph1/SurfaceGraph1.pg]
* File location in NPL: <code>FortLewis/Authoring/Templates/Parametric/SurfaceGraph1/SurfaceGraph1.pg</code>
 
   
 
<br clear="all" />
 
<br clear="all" />
Line 149: Line 148:
 
Context()->texStrings;
 
Context()->texStrings;
 
BEGIN_SOLUTION
 
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
 
 
Solution explanation goes here.
 
Solution explanation goes here.
 
END_SOLUTION
 
END_SOLUTION
Line 172: Line 170:
   
 
[[Category:Top]]
 
[[Category:Top]]
[[Category:Authors]]
+
[[Category:Sample Problems]]
  +
[[Category:Subject Area Templates]]

Revision as of 17:22, 7 June 2015

Deprecated: Graphing a Parametric Surface in 3D

Click to enlarge

This PG code shows how to make an interactive graph of a parametric surface 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",
"LiveGraphicsParametricSurface3D.pl",
);

TEXT(beginproblem());

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

Context("Numeric");

Context()->variables->are(x=>"Real",y=>"Real",z=>"Real",u=>"Real",v=>"Real");

$plot = ParametricSurface3D(
Fx => Formula("3*cos(u)*sin(v)"),
Fy => Formula("3*sin(u)*sin(v)"),
Fz => Formula("3*cos(v)"),
uvar => 'u', # theta
vvar => 'v', # phi
umin => 0,
umax =>  2*pi,
vmin =>  0,
vmax =>  pi,
usamples => 15,
vsamples => 15,
axesframed => 1,
xaxislabel => "X",
yaxislabel => "Y",
zaxislabel => "Z",
mesh => 0,
outputtype => 4,
);

Setup:

Context()->texStrings;
BEGIN_TEXT
\{ 
Live3Ddata(
$plot,
image => "sphere.png", 
size => [400,400],
tex_size => 600,
tex_center => 1,
scale => 1.1,
);
\}
END_TEXT
Context()->normalStrings;

Main Text: We generate a string of plot data using ParametricSurface3D().

Setting outputtype to something other than 4 will require you to read the source code of LiveGraphicsParametricSurface3D.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.

$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