DOCUMENT();

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

$plot_setup = qq/
\tikzset{>={Stealth[scale = 1.5]}}
\filldraw[
    draw = LightBlue,
    fill = white,
    rounded corners = 10pt,
    thick,
    use as bounding box
] (-5, 5) rectangle (5, -5);
\draw[lightgray, dashed] (-5, -5) grid (5, 5);
\draw[->] (-5, 0) -- (5, 0) node[below left] {\(x\)};
\foreach \x in {-4, ..., -1, 1, 2, ..., 4} \draw (\x, -4.5) node {\(\x\)};
\draw[->] (0, -5) -- (0, 5) node[below right] {\(y\)};
\foreach \y in {-4, ..., -1, 1, 2, ..., 4} \draw (-4.5, \y) node {\(\y\)};
/;

# The vertices of the triangle chosen randomly will be ($x0, $y0), ($x1, $y0)
# and ($x0, $y1).
$x0 = random(-3, -1);
$x1 = random( 1,  3);
$y0 = random(-3, -1);
$y1 = random( 1,  3);

$graph1 = createTikZImage();
$graph1->tikzLibraries('arrows.meta');
$graph1->BEGIN_TIKZ
$plot_setup;
\filldraw[very thick, fill = LightGreen, draw = DarkGreen, opacity = 0.5]
    ($x0, $y0) -- ($x1, $y0) -- ($x0, $y1) -- cycle;
END_TIKZ

$graph1AltText =
    "A filled triangle with vertices at ($x0, $y0), ($x1, $y0), and ($x0, $y1).";

# A plot of 1+sqrt(x) and shade underneath the graph.

$graph2 = createTikZImage();
$graph2->tikzLibraries('arrows.meta');
$graph2->BEGIN_TIKZ
$plot_setup;
\filldraw[fill = LightBlue, opacity = 0.5, draw = blue]
    (1,0) -- plot[domain = 1:4] (\x, {1 + sqrt(\x)}) -- (4,0) -- cycle;
\draw[very thick, DarkBlue]
    plot [samples = 100, domain = 0:5, smooth] (\x, {1 + sqrt(\x)});
END_TIKZ

$graph2AltText =
    'The graph of a curve that starts at (0, 1) and increases to the right, '
    . 'increasing sharply at first, and less so as it continues to the right. '
    . 'The region above the x-axis and below the curve between '
    . 'x = 1 and x = 4 is filled.';

# A circle of radius 3 centered at ($x, $y).
$x = random(-2, 2);
$y = random(-2, 2);

$graph3 = createTikZImage();
$graph3->tikzLibraries('arrows.meta');
$graph3->BEGIN_TIKZ
$plot_setup;
\filldraw[very thick, fill = LightSalmon, opacity = 0.5, draw = DarkOrange]
    ($x, $y) circle[radius = 3];
END_TIKZ

$graph3AltText = "A circle of radius 3 centered at ($x, $y).";

BEGIN_PGML
[![$graph1AltText]!]{$graph1}{400}

[![$graph2AltText]!]{$graph2}{400}

[![$graph3AltText]!]{$graph3}{400}
END_PGML

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();