Polar Graph (tikz)

Graphing a polar curve given by r = f(theta)

Complete Code

Download file: PolarGraph.pg

POD for Macro Files

PG problem file

Explanation

DOCUMENT();

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

Preamble

The PGtikz.pl macro is used to generate the graph.

Context()->variables->are(t => 'Real');

$graph = createTikZImage();
$graph->tikzLibraries('arrows.meta');
$graph->BEGIN_TIKZ
\tikzset{>={Stealth[scale = 1.5]}}
\filldraw[
    draw = LightBlue,
    fill = white,
    rounded corners = 10pt,
    thick,
    use as bounding box
] (-3.5, -3.5) rectangle (3.5, 3.5);
\draw[->] (-3.5, 0) -- (3.5, 0) node[above left, outer sep = 3pt] {\(x\)};
\draw[->] (0, -3.5) -- (0, 3.5) node[below right,outer sep = 3pt] {\(y\)};
\draw[DarkGreen, very thick]
    plot [samples = 200, domain = 0:{2 * pi}, variable = \t]
    ({3 * cos(5 * \t r) * cos(\t r)}, {3 * cos(5 * \t r) * sin(\t r)});
\fill[opacity = 0.5, fill = DarkGreen]
    (0, 0) -- plot[samples = 100, domain = {-pi / 10}:{pi / 10}, variable = \t]
    ({3 * cos(5 * \t r) * cos(\t r)}, {3 * cos(5 * \t r) * sin(\t r)}) -- cycle;
END_TIKZ

Setup

The polar curve is plotted parametrically.

BEGIN_PGML
Find the area enclosed by one petal of the rose curve
[`r = f(\theta) = \cos(5\theta)`].

>>[!a rose curve!]{$graph}{300}<<
>>Graph of [`r = \cos(5\theta)`]<<

Area = [_____]{'pi / 20'}
END_PGML

Statement

The alternate text provided in this example is not sufficient. I don’t know how one would describe a rose curve to someone who can not see it. Perhaps seek assistance from an expert in assistive technologies to find a better description.

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution

A solution should be provided here.