Surface Graph in Rectangular Coordinates

This shows an interactive graph in 3D in rectangular coordinates.

Complete Code

Download file: RectangularGraph3D.pg

POD for Macro Files

PG problem file

Explanation

DOCUMENT();

loadMacros('PGstandard.pl', 'PGML.pl', 'plotly3D.pl', 'PGcourse.pl');

Preamble

The dynamic graph is generated with plotly3D.pl.

$graph = Graph3D();
$graph->addSurface(
    [ 'x', 'y', 'x^2 + y^2' ],
    [ -3,  3,   30 ],
    [ -3,  3,   30 ],
    variables => [ 'x', 'y' ]
);

Setup

Generate the plot parametrically for the function z = x^2 + y^2 with the addSurface function. The variables x and y are used as is customary for rectangular coordinates. Since x and y are not the default variables used by a graph created with the addSurface method, the variables must be specified.

See plotly3D.pl for more information, as well as Surface Graph in Cylindrical Coordinates for details on using the addSurface method of a Graph3D object.

BEGIN_PGML
The following is the plot of [`z = x^2 + y^2`]

[@ $graph->Print @]*
END_PGML

Statement

If $graph is a Graph3D object, then insert its graph into the problem with [@ $graph->Print @]*.

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution

A solution should be provided here.