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, so this is needed.

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

Setup

We generate the plot parametrically for the function z=x^2+y^2 with the addSurface function. Since x and y are generally used with rectangular coordinates, we set them with the

variables => ['x','y']

See plotly3D.pl for more information on options.

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

[@ $gr->Print @]*
END_PGML

Statement

This shows how to add a plot to the problem.

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution

A solution should be provided here.