CalculusWithJuliaNotes.jl/quarto/308797b5/differentiable_vector_calculus/polar_coordinates.html
2022-08-11 13:00:43 -04:00

2100 lines
127 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.0.32">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Calculus with Julia - 52&nbsp; Polar Coordinates and Curves</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script src="../site_libs/quarto-nav/quarto-nav.js"></script>
<script src="../site_libs/quarto-nav/headroom.min.js"></script>
<script src="../site_libs/clipboard/clipboard.min.js"></script>
<script src="../site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="../site_libs/quarto-search/fuse.min.js"></script>
<script src="../site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="../">
<link href="../differentiable_vector_calculus/vectors.html" rel="next">
<link href="../ODEs/differential_equations.html" rel="prev">
<script src="../site_libs/quarto-html/quarto.js"></script>
<script src="../site_libs/quarto-html/popper.min.js"></script>
<script src="../site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="../site_libs/quarto-html/anchor.min.js"></script>
<link href="../site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="../site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="../site_libs/bootstrap/bootstrap.min.js"></script>
<link href="../site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="../site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script id="quarto-search-options" type="application/json">{
"location": "navbar",
"copy-button": false,
"collapse-after": 3,
"panel-placement": "end",
"type": "overlay",
"limit": 20,
"language": {
"search-no-results-text": "No results",
"search-matching-documents-text": "matching documents",
"search-copy-link-title": "Copy link to search",
"search-hide-matches-text": "Hide additional matches",
"search-more-match-text": "more match in this document",
"search-more-matches-text": "more matches in this document",
"search-clear-button-title": "Clear",
"search-detached-cancel-button-title": "Cancel",
"search-submit-button-title": "Submit"
}
}</script>
<script async="" src="https://hypothes.is/embed.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" integrity="sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script type="application/javascript">define('jquery', [],function() {return window.jQuery;})</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>
</head>
<body class="nav-sidebar floating nav-fixed">
<div id="quarto-search-results"></div>
<header id="quarto-header" class="headroom fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark ">
<div class="navbar-container container-fluid">
<a class="navbar-brand" href="../index.html">
<img src="../logo.png" alt="">
<span class="navbar-title">Calculus with Julia</span>
</a>
<div id="quarto-search" class="" title="Search"></div>
</div> <!-- /container-fluid -->
</nav>
<nav class="quarto-secondary-nav" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<div class="container-fluid d-flex justify-content-between">
<h1 class="quarto-secondary-nav-title"><span class="chapter-number">52</span>&nbsp; <span class="chapter-title">Polar Coordinates and Curves</span></h1>
<button type="button" class="quarto-btn-toggle btn" aria-label="Show secondary navigation">
<i class="bi bi-chevron-right"></i>
</button>
</div>
</nav>
</header>
<!-- content -->
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article page-navbar">
<!-- sidebar -->
<nav id="quarto-sidebar" class="sidebar collapse sidebar-navigation floating overflow-auto">
<div class="mt-2 flex-shrink-0 align-items-center">
<div class="sidebar-search">
<div id="quarto-search" class="" title="Search"></div>
</div>
</div>
<div class="sidebar-menu-container">
<ul class="list-unstyled mt-1">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../index.html" class="sidebar-item-text sidebar-link">Preface</a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="false">Precalculus Concepts</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/calculator.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">From calculator to computer</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/variables.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Variables</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/numbers_types.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Number systems</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/logical_expressions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">4</span>&nbsp; <span class="chapter-title">Inequalities, Logical expressions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/vectors.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Vectors</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/ranges.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">6</span>&nbsp; <span class="chapter-title">Ranges and Sets</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">7</span>&nbsp; <span class="chapter-title">Functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/plotting.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">8</span>&nbsp; <span class="chapter-title">The Graph of a Function</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/transformations.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">9</span>&nbsp; <span class="chapter-title">Function manipulations</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/inversefunctions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">10</span>&nbsp; <span class="chapter-title">The Inverse of a Function</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/polynomial.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">11</span>&nbsp; <span class="chapter-title">Polynomials</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/polynomial_roots.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">12</span>&nbsp; <span class="chapter-title">Roots of a polynomial</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/polynomials_package.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">13</span>&nbsp; <span class="chapter-title">The Polynomials package</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/rational_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">14</span>&nbsp; <span class="chapter-title">Rational functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/exp_log_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">15</span>&nbsp; <span class="chapter-title">Exponential and logarithmic functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/trig_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">16</span>&nbsp; <span class="chapter-title">Trigonometric functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../precalc/julia_overview.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">17</span>&nbsp; <span class="chapter-title">Overview of Julia commands</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="false">Limits</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../limits/limits.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">18</span>&nbsp; <span class="chapter-title">Limits</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../limits/limits_extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">19</span>&nbsp; <span class="chapter-title">Limits, issues, extensions of the concept</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../limits/continuity.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">20</span>&nbsp; <span class="chapter-title">Continuity</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../limits/intermediate_value_theorem.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">21</span>&nbsp; <span class="chapter-title">Implications of continuity</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="false">Derivatives</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/derivatives.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">22</span>&nbsp; <span class="chapter-title">Derivatives</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/numeric_derivatives.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">23</span>&nbsp; <span class="chapter-title">Numeric derivatives</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/symbolic_derivatives.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">24</span>&nbsp; <span class="chapter-title">Symbolic derivatives</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/mean_value_theorem.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">25</span>&nbsp; <span class="chapter-title">The mean value theorem for differentiable functions.</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/optimization.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">26</span>&nbsp; <span class="chapter-title">Optimization</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/first_second_derivatives.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">27</span>&nbsp; <span class="chapter-title">The first and second derivatives</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/curve_sketching.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">28</span>&nbsp; <span class="chapter-title">Curve Sketching</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/linearization.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">29</span>&nbsp; <span class="chapter-title">Linearization</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/newtons_method.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">30</span>&nbsp; <span class="chapter-title">Newtons method</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/more_zeros.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">31</span>&nbsp; <span class="chapter-title">Derivative-free alternatives to Newtons method</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/lhospitals_rule.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">32</span>&nbsp; <span class="chapter-title">LHospitals Rule</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/implicit_differentiation.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">33</span>&nbsp; <span class="chapter-title">Implicit Differentiation</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/related_rates.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">34</span>&nbsp; <span class="chapter-title">Related rates</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../derivatives/taylor_series_polynomials.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">35</span>&nbsp; <span class="chapter-title">Taylor Polynomials and other Approximating Polynomials</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="false">Integrals</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/area.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">36</span>&nbsp; <span class="chapter-title">Area under a curve</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/ftc.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">37</span>&nbsp; <span class="chapter-title">Fundamental Theorem or Calculus</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/substitution.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">38</span>&nbsp; <span class="chapter-title">Substitution</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/integration_by_parts.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">39</span>&nbsp; <span class="chapter-title">Integration By Parts</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/partial_fractions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">40</span>&nbsp; <span class="chapter-title">Partial Fractions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/improper_integrals.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">41</span>&nbsp; <span class="chapter-title">Improper Integrals</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/mean_value_theorem.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">42</span>&nbsp; <span class="chapter-title">Mean value theorem for integrals</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/area_between_curves.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">43</span>&nbsp; <span class="chapter-title">Area between two curves</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/center_of_mass.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">44</span>&nbsp; <span class="chapter-title">Center of Mass</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/volumes_slice.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">45</span>&nbsp; <span class="chapter-title">Volumes by slicing</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/arc_length.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">46</span>&nbsp; <span class="chapter-title">Arc length</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integrals/surface_area.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">47</span>&nbsp; <span class="chapter-title">Surface Area</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" aria-expanded="false">ODEs</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-5" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../ODEs/odes.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">48</span>&nbsp; <span class="chapter-title">ODEs</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../ODEs/euler.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">49</span>&nbsp; <span class="chapter-title">Eulers method</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../ODEs/solve.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">50</span>&nbsp; <span class="chapter-title">The problem-algorithm-solve interface</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../ODEs/differential_equations.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">51</span>&nbsp; <span class="chapter-title">The <code>DifferentialEquations</code> suite</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="true">Differential vector calculus</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-6" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/polar_coordinates.html" class="sidebar-item-text sidebar-link active"><span class="chapter-number">52</span>&nbsp; <span class="chapter-title">Polar Coordinates and Curves</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/vectors.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">53</span>&nbsp; <span class="chapter-title">Vectors and matrices</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/vector_valued_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">54</span>&nbsp; <span class="chapter-title">Vector-valued functions, <span class="math inline">\(f:R \rightarrow R^n\)</span></span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/scalar_functions.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">55</span>&nbsp; <span class="chapter-title">Scalar functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/scalar_functions_applications.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">56</span>&nbsp; <span class="chapter-title">Applications with scalar functions</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/vector_fields.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">57</span>&nbsp; <span class="chapter-title">Functions <span class="math inline">\(R^n \rightarrow R^m\)</span></span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../differentiable_vector_calculus/plots_plotting.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">58</span>&nbsp; <span class="chapter-title">2D and 3D plots in Julia with Plots</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" aria-expanded="false">Integral vector calculus</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-7" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/double_triple_integrals.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">59</span>&nbsp; <span class="chapter-title">Multi-dimensional integrals</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/line_integrals.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">60</span>&nbsp; <span class="chapter-title">Line and Surface Integrals</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/div_grad_curl.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">61</span>&nbsp; <span class="chapter-title">The Gradient, Divergence, and Curl</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/stokes_theorem.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">62</span>&nbsp; <span class="chapter-title">Greens Theorem, Stokes Theorem, and the Divergence Theorem</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../integral_vector_calculus/review.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">63</span>&nbsp; <span class="chapter-title">Quick Review of Vector Calculus</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-8" aria-expanded="false">Alternatives</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-8" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-8" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../alternatives/plotly_plotting.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">64</span>&nbsp; <span class="chapter-title">JavaScript based plotting libraries</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../alternatives/makie_plotting.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">65</span>&nbsp; <span class="chapter-title">Calculus plots with Makie</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-9" aria-expanded="false">Appendices</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-9" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-9" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/getting_started_with_julia.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">66</span>&nbsp; <span class="chapter-title">Getting started with Julia</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/julia_interfaces.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">67</span>&nbsp; <span class="chapter-title">Julia interfaces</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/calculus_with_julia.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">68</span>&nbsp; <span class="chapter-title">The <code>CalculusWithJulia</code> package</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/unicode.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">69</span>&nbsp; <span class="chapter-title">Usages of Unicode symbols</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../misc/quick_notes.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">70</span>&nbsp; <span class="chapter-title">Quick introduction to Calculus with Julia</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../references.html" class="sidebar-item-text sidebar-link">References</a>
</div>
</li>
</ul>
</div>
</nav>
<!-- margin-sidebar -->
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
<nav id="TOC" role="doc-toc">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#definition-of-polar-coordinates" id="toc-definition-of-polar-coordinates" class="nav-link active" data-scroll-target="#definition-of-polar-coordinates"> <span class="header-section-number">52.1</span> Definition of polar coordinates</a></li>
<li><a href="#parameterizing-curves-using-polar-coordinates" id="toc-parameterizing-curves-using-polar-coordinates" class="nav-link" data-scroll-target="#parameterizing-curves-using-polar-coordinates"> <span class="header-section-number">52.2</span> Parameterizing curves using polar coordinates</a></li>
<li><a href="#area-of-polar-graphs" id="toc-area-of-polar-graphs" class="nav-link" data-scroll-target="#area-of-polar-graphs"> <span class="header-section-number">52.3</span> Area of polar graphs</a></li>
<li><a href="#arc-length" id="toc-arc-length" class="nav-link" data-scroll-target="#arc-length"> <span class="header-section-number">52.4</span> Arc length</a></li>
<li><a href="#questions" id="toc-questions" class="nav-link" data-scroll-target="#questions"> <span class="header-section-number">52.5</span> Questions</a></li>
</ul>
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/jverzani/CalculusWithJuliaNotes.jl/edit/main/quarto/differentiable_vector_calculus/polar_coordinates.qmd" class="toc-action">Edit this page</a></p><p><a href="https://github.com/jverzani/CalculusWithJuliaNotes.jl/issues/new" class="toc-action">Report an issue</a></p></div></div></nav>
</div>
<!-- main -->
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title d-none d-lg-block"><span class="chapter-number">52</span>&nbsp; <span class="chapter-title">Polar Coordinates and Curves</span></h1>
</div>
<div class="quarto-title-meta">
</div>
</header>
<p>This section uses these add-on packages:</p>
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">CalculusWithJulia</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">Plots</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">SymPy</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">Roots</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="im">using</span> <span class="bu">QuadGK</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<hr>
<p>The description of the <span class="math inline">\(x\)</span>-<span class="math inline">\(y\)</span> plane via Cartesian coordinates is not the only possible way, though one that is most familiar. Here we discuss a different means. Instead of talking about over and up from an origin, we focus on a direction and a distance from the origin.</p>
<section id="definition-of-polar-coordinates" class="level2" data-number="52.1">
<h2 data-number="52.1" class="anchored" data-anchor-id="definition-of-polar-coordinates"><span class="header-section-number">52.1</span> Definition of polar coordinates</h2>
<p>Polar coordinates parameterize the plane though an angle <span class="math inline">\(\theta\)</span> made from the positive ray of the <span class="math inline">\(x\)</span> axis and a radius <span class="math inline">\(r\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="4">
<div class="cell-output cell-output-display" data-execution_count="5">
<p><img src="polar_coordinates_files/figure-html/cell-5-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>To recover the Cartesian coordinates from the pair <span class="math inline">\((r,\theta)\)</span>, we have these formulas from <a href="http://en.wikipedia.org/wiki/Polar_coordinate_system#Converting_between_polar_and_Cartesian_coordinates">right</a> triangle geometry:</p>
<p><span class="math display">\[
x = r \cos(\theta),~ y = r \sin(\theta).
\]</span></p>
<p>Each point <span class="math inline">\((x,y)\)</span> corresponds to several possible values of <span class="math inline">\((r,\theta)\)</span>, as any integer multiple of <span class="math inline">\(2\pi\)</span> added to <span class="math inline">\(\theta\)</span> will describe the same point. Except for the origin, there is only one pair when we restrict to <span class="math inline">\(r &gt; 0\)</span> and <span class="math inline">\(0 \leq \theta &lt; 2\pi\)</span>.</p>
<p>For values in the first and fourth quadrants (the range of <span class="math inline">\(\tan^{-1}(x)\)</span>), we have:</p>
<p><span class="math display">\[
r = \sqrt{x^2 + y^2},~ \theta=\tan^{-1}(y/x).
\]</span></p>
<p>For the other two quadrants, the signs of <span class="math inline">\(y\)</span> and <span class="math inline">\(x\)</span> must be considered. This is done with the function <code>atan</code> when two arguments are used.</p>
<p>For example, <span class="math inline">\((-3, 4)\)</span> would have polar coordinates:</p>
<div class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>x,y <span class="op">=</span> <span class="op">-</span><span class="fl">3</span>, <span class="fl">4</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>rad, theta <span class="op">=</span> <span class="fu">sqrt</span>(x<span class="op">^</span><span class="fl">2</span> <span class="op">+</span> y<span class="op">^</span><span class="fl">2</span>), <span class="fu">atan</span>(y, x)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="6">
<pre><code>(5.0, 2.214297435588181)</code></pre>
</div>
</div>
<p>And reversing</p>
<div class="cell" data-execution_count="6">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">rad*cos</span>(theta), <span class="fu">rad*sin</span>(theta)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="7">
<pre><code>(-2.999999999999999, 4.000000000000001)</code></pre>
</div>
</div>
<p>This figure illustrates:</p>
<div class="cell" data-hold="true" data-execution_count="7">
<div class="cell-output cell-output-display" data-execution_count="8">
<p><img src="polar_coordinates_files/figure-html/cell-8-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The case where <span class="math inline">\(r &lt; 0\)</span> is handled by going <span class="math inline">\(180\)</span> degrees in the opposite direction, in other words the point <span class="math inline">\((r, \theta)\)</span> can be described as well by <span class="math inline">\((-r,\theta+\pi)\)</span>.</p>
</section>
<section id="parameterizing-curves-using-polar-coordinates" class="level2" data-number="52.2">
<h2 data-number="52.2" class="anchored" data-anchor-id="parameterizing-curves-using-polar-coordinates"><span class="header-section-number">52.2</span> Parameterizing curves using polar coordinates</h2>
<p>If <span class="math inline">\(r=r(\theta)\)</span>, then the parameterized curve <span class="math inline">\((r(\theta), \theta)\)</span> is just the set of points generated as <span class="math inline">\(\theta\)</span> ranges over some set of values. There are many examples of parameterized curves that simplify what might be a complicated presentation in Cartesian coordinates.</p>
<p>For example, a circle has the form <span class="math inline">\(x^2 + y^2 = R^2\)</span>. Whereas parameterized by polar coordinates it is just <span class="math inline">\(r(\theta) = R\)</span>, or a constant function.</p>
<p>The circle centered at <span class="math inline">\((r_0, \gamma)\)</span> (in polar coordinates) with radius <span class="math inline">\(R\)</span> has a more involved description in polar coordinates:</p>
<p><span class="math display">\[
r(\theta) = r_0 \cos(\theta - \gamma) + \sqrt{R^2 - r_0^2\sin^2(\theta - \gamma)}.
\]</span></p>
<p>The case where <span class="math inline">\(r_0 &gt; R\)</span> will not be defined for all values of <span class="math inline">\(\theta\)</span>, only when <span class="math inline">\(|\sin(\theta-\gamma)| \leq R/r_0\)</span>.</p>
<section id="examples" class="level4">
<h4 class="anchored" data-anchor-id="examples">Examples</h4>
<p>The <code>Plots.jl</code> package provides a means to visualize polar plots through <code>plot(thetas, rs, proj=:polar)</code>. For example, to plot a circe with <span class="math inline">\(r_0=1/2\)</span> and <span class="math inline">\(\gamma=\pi/6\)</span> we would have:</p>
<div class="cell" data-hold="true" data-execution_count="8">
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>R, r0, gamma <span class="op">=</span> <span class="fl">1</span>, <span class="fl">1</span><span class="op">/</span><span class="fl">2</span>, <span class="cn">pi</span><span class="op">/</span><span class="fl">6</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(theta) <span class="op">=</span> r0 <span class="op">*</span> <span class="fu">cos</span>(theta<span class="op">-</span>gamma) <span class="op">+</span> <span class="fu">sqrt</span>(R<span class="op">^</span><span class="fl">2</span> <span class="op">-</span> r0<span class="op">^</span><span class="fl">2</span><span class="fu">*sin</span>(theta<span class="op">-</span>gamma)<span class="op">^</span><span class="fl">2</span>)</span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a>ts <span class="op">=</span> <span class="fu">range</span>(<span class="fl">0</span>, <span class="fl">2</span>pi, length<span class="op">=</span><span class="fl">100</span>)</span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a>rs <span class="op">=</span> <span class="fu">r</span>.(ts)</span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="fu">plot</span>(ts, rs, proj<span class="op">=:</span>polar, legend<span class="op">=</span><span class="cn">false</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="9">
<p><img src="polar_coordinates_files/figure-html/cell-9-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>To avoid having to create values for <span class="math inline">\(\theta\)</span> and values for <span class="math inline">\(r\)</span>, the <code>CalculusWithJulia</code> package provides a helper function, <code>plot_polar</code>. To distinguish it from other functions provided by <code>Plots</code>, the calling pattern is different. It specifies an interval to plot over by <code>a..b</code> and puts that first (this notation for closed intervals is from <code>IntervalSets</code>), followed by <code>r</code>. Other keyword arguments are passed onto a <code>plot</code> call.</p>
<p>We will use this in the following, as the graphs are a bit more familiar and the calling pattern similar to how we have plotted functions.</p>
<p>As <code>Plots</code> will make a parametric plot when called as <code>plot(function, function, a,b)</code>, the above function creates two such functions using the relationship <span class="math inline">\(x=r\cos(\theta)\)</span> and <span class="math inline">\(y=r\sin(\theta)\)</span>.</p>
<p>Using <code>plot_polar</code>, we can plot circles with the following. We have to be a bit careful for the general circle, as when the center is farther away from the origin that the radius (<span class="math inline">\(R\)</span>), then not all angles will be acceptable and there are two functions needed to describe the radius, as this comes from a quadratic equation and both the “plus” and “minus” terms are used.</p>
<div class="cell" data-hold="true" data-execution_count="9">
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>R<span class="op">=</span><span class="fl">4</span>; <span class="fu">r</span>(t) <span class="op">=</span> R;</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">plot_general_circle!</span>(r0, gamma, R)</span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="co"># law of cosines has if gamma=0, |theta| &lt;= asin(R/r0)</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a> <span class="co"># R^2 = a^2 + r^2 - 2a*r*cos(theta); solve for a</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">r</span>(t) <span class="op">=</span> r0 <span class="op">*</span> <span class="fu">cos</span>(t <span class="op">-</span> gamma) <span class="op">+</span> <span class="fu">sqrt</span>(R<span class="op">^</span><span class="fl">2</span> <span class="op">-</span> r0<span class="op">^</span><span class="fl">2</span><span class="fu">*sin</span>(t<span class="op">-</span>gamma)<span class="op">^</span><span class="fl">2</span>)</span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">l</span>(t) <span class="op">=</span> r0 <span class="op">*</span> <span class="fu">cos</span>(t <span class="op">-</span> gamma) <span class="op">-</span> <span class="fu">sqrt</span>(R<span class="op">^</span><span class="fl">2</span> <span class="op">-</span> r0<span class="op">^</span><span class="fl">2</span><span class="fu">*sin</span>(t<span class="op">-</span>gamma)<span class="op">^</span><span class="fl">2</span>)</span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> R <span class="op">&lt;</span> r0</span>
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true" tabindex="-1"></a> theta <span class="op">=</span> <span class="fu">asin</span>(R<span class="op">/</span>r0)<span class="op">-</span><span class="fl">1e-6</span> <span class="co"># avoid round off issues</span></span>
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true" tabindex="-1"></a> <span class="fu">plot_polar!</span>((gamma<span class="op">-</span>theta)<span class="op">..</span>(gamma<span class="op">+</span>theta), r)</span>
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">plot_polar!</span>((gamma<span class="op">-</span>theta)<span class="op">..</span>(gamma<span class="op">+</span>theta), l)</span>
<span id="cb7-13"><a href="#cb7-13" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span></span>
<span id="cb7-14"><a href="#cb7-14" aria-hidden="true" tabindex="-1"></a> <span class="fu">plot_polar!</span>(<span class="fl">0</span><span class="op">..</span><span class="fl">2</span>pi, r)</span>
<span id="cb7-15"><a href="#cb7-15" aria-hidden="true" tabindex="-1"></a> <span class="cf">end</span></span>
<span id="cb7-16"><a href="#cb7-16" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span>
<span id="cb7-17"><a href="#cb7-17" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-18"><a href="#cb7-18" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_polar</span>(<span class="fl">0</span><span class="op">..</span><span class="fl">2</span>pi, r, aspect_ratio<span class="op">=:</span>equal, legend<span class="op">=</span><span class="cn">false</span>)</span>
<span id="cb7-19"><a href="#cb7-19" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_general_circle!</span>(<span class="fl">2</span>, <span class="fl">0</span>, <span class="fl">2</span>)</span>
<span id="cb7-20"><a href="#cb7-20" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_general_circle!</span>(<span class="fl">3</span>, <span class="fl">0</span>, <span class="fl">1</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="10">
<p><img src="polar_coordinates_files/figure-html/cell-10-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>There are many interesting examples of curves described by polar coordinates. An interesting <a href="http://www-history.mcs.st-and.ac.uk/Curves/Curves.html">compilation</a> of famous curves is found at the MacTutor History of Mathematics archive, many of which have formulas in polar coordinates.</p>
<section id="example" class="level5">
<h5 class="anchored" data-anchor-id="example">Example</h5>
<p>The <a href="http://www-history.mcs.st-and.ac.uk/Curves/Rhodonea.html">rhodenea</a> curve has</p>
<p><span class="math display">\[
r(\theta) = a \sin(k\theta)
\]</span></p>
<div class="cell" data-hold="true" data-execution_count="10">
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>a, k <span class="op">=</span> <span class="fl">4</span>, <span class="fl">5</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(theta) <span class="op">=</span> a <span class="op">*</span> <span class="fu">sin</span>(k <span class="op">*</span> theta)</span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_polar</span>(<span class="fl">0</span><span class="op">..</span><span class="cn">pi</span>, r)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="11">
<p><img src="polar_coordinates_files/figure-html/cell-11-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>This graph has radius <span class="math inline">\(0\)</span> whenever <span class="math inline">\(\sin(k\theta) = 0\)</span> or <span class="math inline">\(k\theta =n\pi\)</span>. Solving means that it is <span class="math inline">\(0\)</span> at integer multiples of <span class="math inline">\(\pi/k\)</span>. In the above, with <span class="math inline">\(k=5\)</span>, there will <span class="math inline">\(5\)</span> zeroes in <span class="math inline">\([0,\pi]\)</span>. The entire curve is traced out over this interval, the values from <span class="math inline">\(\pi\)</span> to <span class="math inline">\(2\pi\)</span> yield negative value of <span class="math inline">\(r\)</span>, so are related to values within <span class="math inline">\(0\)</span> to <span class="math inline">\(\pi\)</span> via the relation <span class="math inline">\((r,\pi +\theta) = (-r, \theta)\)</span>.</p>
</section>
<section id="example-1" class="level5">
<h5 class="anchored" data-anchor-id="example-1">Example</h5>
<p>The <a href="http://www-history.mcs.st-and.ac.uk/Curves/Folium.html">folium</a> is a somewhat similar looking curve, but has this description:</p>
<p><span class="math display">\[
r(\theta) = -b \cos(\theta) + 4a \cos(\theta) \sin(2\theta)
\]</span></p>
<div class="cell" data-execution_count="11">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>𝒂, 𝒃 <span class="op">=</span> <span class="fl">4</span>, <span class="fl">2</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="fu">𝒓</span>(theta) <span class="op">=</span> <span class="op">-</span>𝒃 <span class="op">*</span> <span class="fu">cos</span>(theta) <span class="op">+</span> <span class="fl">4</span>𝒂 <span class="op">*</span> <span class="fu">cos</span>(theta) <span class="op">*</span> <span class="fu">sin</span>(<span class="fl">2</span>theta)</span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_polar</span>(<span class="fl">0</span><span class="op">..</span><span class="fl">2</span>pi, 𝒓)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="12">
<p><img src="polar_coordinates_files/figure-html/cell-12-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The folium has radial part <span class="math inline">\(0\)</span> when <span class="math inline">\(\cos(\theta) = 0\)</span> or <span class="math inline">\(\sin(2\theta) = b/4a\)</span>. This could be used to find out what values correspond to which loop. For our choice of <span class="math inline">\(a\)</span> and <span class="math inline">\(b\)</span> this gives <span class="math inline">\(\pi/2\)</span>, <span class="math inline">\(3\pi/2\)</span> or, as <span class="math inline">\(b/4a = 1/8\)</span>, when <span class="math inline">\(\sin(2\theta) = 1/8\)</span> which happens at <span class="math inline">\(a_0=\sin^{-1}(1/8)/2=0.0626...\)</span> and <span class="math inline">\(\pi/2 - a_0\)</span>, <span class="math inline">\(\pi+a_0\)</span> and <span class="math inline">\(3\pi/2 - a_0\)</span>. The first folium can be plotted with:</p>
<div class="cell" data-execution_count="12">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>𝒂<span class="fl">0</span> <span class="op">=</span> (<span class="fl">1</span><span class="op">/</span><span class="fl">2</span>) <span class="op">*</span> <span class="fu">asin</span>(<span class="fl">1</span><span class="op">/</span><span class="fl">8</span>)</span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_polar</span>(𝒂<span class="fl">0</span><span class="op">..</span>(<span class="cn">pi</span><span class="op">/</span><span class="fl">2</span><span class="op">-</span>𝒂<span class="fl">0</span>), 𝒓)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="13">
<p><img src="polar_coordinates_files/figure-html/cell-13-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The second - which is too small to appear in the initial plot without zooming in - with</p>
<div class="cell" data-execution_count="13">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_polar</span>((<span class="cn">pi</span><span class="op">/</span><span class="fl">2</span> <span class="op">-</span> 𝒂<span class="fl">0</span>)<span class="op">..</span>(<span class="cn">pi</span><span class="op">/</span><span class="fl">2</span>), 𝒓)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="14">
<p><img src="polar_coordinates_files/figure-html/cell-14-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The third with</p>
<div class="cell" data-execution_count="14">
<div class="sourceCode cell-code" id="cb12"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_polar</span>((<span class="cn">pi</span><span class="op">/</span><span class="fl">2</span>)<span class="op">..</span>(<span class="cn">pi</span> <span class="op">+</span> 𝒂<span class="fl">0</span>), 𝒓)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="15">
<p><img src="polar_coordinates_files/figure-html/cell-15-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>The plot repeats from there, so the initial plot could have been made over <span class="math inline">\([0, \pi + a_0]\)</span>.</p>
</section>
<section id="example-2" class="level5">
<h5 class="anchored" data-anchor-id="example-2">Example</h5>
<p>The <a href="http://www-history.mcs.st-and.ac.uk/Curves/Limacon.html">Limacon of Pascal</a> has</p>
<p><span class="math display">\[
r(\theta) = b + 2a\cos(\theta)
\]</span></p>
<div class="cell" data-hold="true" data-execution_count="15">
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>a,b <span class="op">=</span> <span class="fl">4</span>, <span class="fl">2</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(theta) <span class="op">=</span> b <span class="op">+</span> <span class="fl">2</span><span class="fu">a*cos</span>(theta)</span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_polar</span>(<span class="fl">0</span><span class="op">..</span><span class="fl">2</span>pi, r)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="16">
<p><img src="polar_coordinates_files/figure-html/cell-16-output-1.svg" class="img-fluid"></p>
</div>
</div>
</section>
<section id="example-3" class="level5">
<h5 class="anchored" data-anchor-id="example-3">Example</h5>
<p>Some curves require a longer parameterization, such as this where we plot over <span class="math inline">\([0, 8\pi]\)</span> so that the cosine term can range over an entire half period:</p>
<div class="cell" data-hold="true" data-execution_count="16">
<div class="sourceCode cell-code" id="cb14"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(theta) <span class="op">=</span> <span class="fu">sqrt</span>(<span class="fu">abs</span>(<span class="fu">cos</span>(theta<span class="op">/</span><span class="fl">8</span>)))</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_polar</span>(<span class="fl">0</span><span class="op">..</span><span class="fl">8</span>pi, r)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="17">
<p><img src="polar_coordinates_files/figure-html/cell-17-output-1.svg" class="img-fluid"></p>
</div>
</div>
</section>
</section>
</section>
<section id="area-of-polar-graphs" class="level2" data-number="52.3">
<h2 data-number="52.3" class="anchored" data-anchor-id="area-of-polar-graphs"><span class="header-section-number">52.3</span> Area of polar graphs</h2>
<p>Consider the <a href="http://www-history.mcs.st-and.ac.uk/Curves/Cardioid.html">cardioid</a> described by <span class="math inline">\(r(\theta) = 2(1 + \cos(\theta))\)</span>:</p>
<div class="cell" data-hold="true" data-execution_count="17">
<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(theta) <span class="op">=</span> <span class="fl">2</span>(<span class="fl">1</span> <span class="op">+</span> <span class="fu">cos</span>(theta))</span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_polar</span>(<span class="fl">0</span><span class="op">..</span><span class="fl">2</span>pi, r)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="18">
<p><img src="polar_coordinates_files/figure-html/cell-18-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>How much area is contained in the graph?</p>
<p>In some cases it might be possible to translate back into Cartesian coordinates and compute from there. In practice, this is not usually the best solution.</p>
<p>The area can be approximated by wedges (not rectangles). For example, here we see that the area over a given angle is well approximated by the wedge for each of the sectors:</p>
<div class="cell" data-hold="true" data-execution_count="18">
<div class="cell-output cell-output-display" data-execution_count="19">
<p><img src="polar_coordinates_files/figure-html/cell-19-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>As well, see this part of a <a href="http://en.wikipedia.org/wiki/Polar_coordinate_system#Integral_calculus_.28area.29">Wikipedia</a> page for a figure.</p>
<p>Imagine we have <span class="math inline">\(a &lt; b\)</span> and a partition <span class="math inline">\(a=t_0 &lt; t_1 &lt; \cdots &lt; t_n = b\)</span>. Let <span class="math inline">\(\phi_i = (1/2)(t_{i-1} + t_{i})\)</span> be the midpoint. Then the wedge of radius <span class="math inline">\(r(\phi_i)\)</span> with angle between <span class="math inline">\(t_{i-1}\)</span> and <span class="math inline">\(t_i\)</span> will have area <span class="math inline">\(\pi r(\phi_i)^2 (t_i-t_{i-1}) / (2\pi) = (1/2) r(\phi_i)(t_i-t_{i-1})\)</span>, the ratio <span class="math inline">\((t_i-t_{i-1}) / (2\pi)\)</span> being the angle to the total angle of a circle. Summing the area of these wedges over the partition gives a Riemann sum approximation for the integral <span class="math inline">\((1/2)\int_a^b r(\theta)^2 d\theta\)</span>. This limit of this sum defines the area in polar coordinates.</p>
<blockquote class="blockquote">
<p><em>Area of polar regions</em>. Let <span class="math inline">\(R\)</span> denote the region bounded by the curve <span class="math inline">\(r(\theta)\)</span> and bounded by the rays <span class="math inline">\(\theta=a\)</span> and <span class="math inline">\(\theta=b\)</span> with <span class="math inline">\(b-a \leq 2\pi\)</span>, then the area of <span class="math inline">\(R\)</span> is given by:</p>
<p><span class="math inline">\(A = \frac{1}{2}\int_a^b r(\theta)^2 d\theta.\)</span></p>
</blockquote>
<p>So the area of the cardioid, which is parameterized over <span class="math inline">\([0, 2\pi]\)</span> is found by</p>
<div class="cell" data-hold="true" data-execution_count="19">
<div class="sourceCode cell-code" id="cb16"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(theta) <span class="op">=</span> <span class="fl">2</span>(<span class="fl">1</span> <span class="op">+</span> <span class="fu">cos</span>(theta))</span>
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> theta</span>
<span id="cb16-3"><a href="#cb16-3" aria-hidden="true" tabindex="-1"></a>(<span class="fl">1</span><span class="op">//</span><span class="fl">2</span>) <span class="op">*</span> <span class="fu">integrate</span>(<span class="fu">r</span>(theta)<span class="op">^</span><span class="fl">2</span>, (theta, <span class="fl">0</span>, <span class="fl">2</span>PI))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="20">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
6 \pi
\]
</span>
</div>
</div>
<section id="example-4" class="level5">
<h5 class="anchored" data-anchor-id="example-4">Example</h5>
<p>The folium has general formula <span class="math inline">\(r(\theta) = -b \cos(\theta) +4a\cos(\theta)\sin(\theta)^2\)</span>. When <span class="math inline">\(a=1\)</span> and <span class="math inline">\(b=1\)</span> a leaf of the folium is traced out between <span class="math inline">\(\pi/6\)</span> and <span class="math inline">\(\pi/2\)</span>. What is the area of that leaf?</p>
<p>An antiderivative exists for arbitrary <span class="math inline">\(a\)</span> and <span class="math inline">\(b\)</span>:</p>
<div class="cell" data-execution_count="20">
<div class="sourceCode cell-code" id="cb17"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> 𝐚 𝐛 𝐭heta</span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a><span class="fu">𝐫</span>(theta) <span class="op">=</span> <span class="fu">-𝐛*cos</span>(theta) <span class="op">+</span> <span class="fl">4</span><span class="fu">𝐚*cos</span>(theta)<span class="fu">*sin</span>(theta)<span class="op">^</span><span class="fl">2</span></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a><span class="fu">integrate</span>(<span class="fu">𝐫</span>(𝐭heta)<span class="op">^</span><span class="fl">2</span>, 𝐭heta) <span class="op">/</span> <span class="fl">2</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="21">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\frac{𝐚^{2} 𝐭heta \sin^{6}{\left(𝐭heta \right)}}{2} + \frac{3 𝐚^{2} 𝐭heta \sin^{4}{\left(𝐭heta \right)} \cos^{2}{\left(𝐭heta \right)}}{2} + \frac{3 𝐚^{2} 𝐭heta \sin^{2}{\left(𝐭heta \right)} \cos^{4}{\left(𝐭heta \right)}}{2} + \frac{𝐚^{2} 𝐭heta \cos^{6}{\left(𝐭heta \right)}}{2} + \frac{𝐚^{2} \sin^{5}{\left(𝐭heta \right)} \cos{\left(𝐭heta \right)}}{2} - \frac{4 𝐚^{2} \sin^{3}{\left(𝐭heta \right)} \cos^{3}{\left(𝐭heta \right)}}{3} - \frac{𝐚^{2} \sin{\left(𝐭heta \right)} \cos^{5}{\left(𝐭heta \right)}}{2} - \frac{𝐚 𝐛 𝐭heta \sin^{4}{\left(𝐭heta \right)}}{2} - 𝐚 𝐛 𝐭heta \sin^{2}{\left(𝐭heta \right)} \cos^{2}{\left(𝐭heta \right)} - \frac{𝐚 𝐛 𝐭heta \cos^{4}{\left(𝐭heta \right)}}{2} - \frac{𝐚 𝐛 \sin^{3}{\left(𝐭heta \right)} \cos{\left(𝐭heta \right)}}{2} + \frac{𝐚 𝐛 \sin{\left(𝐭heta \right)} \cos^{3}{\left(𝐭heta \right)}}{2} + \frac{𝐛^{2} 𝐭heta \sin^{2}{\left(𝐭heta \right)}}{4} + \frac{𝐛^{2} 𝐭heta \cos^{2}{\left(𝐭heta \right)}}{4} + \frac{𝐛^{2} \sin{\left(𝐭heta \right)} \cos{\left(𝐭heta \right)}}{4}
\]
</span>
</div>
</div>
<p>For our specific values, the answer can be computed with:</p>
<div class="cell" data-execution_count="21">
<div class="sourceCode cell-code" id="cb18"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a>ex <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">𝐫</span>(𝐭heta)<span class="op">^</span><span class="fl">2</span>, (𝐭heta, PI<span class="op">/</span><span class="fl">6</span>, PI<span class="op">/</span><span class="fl">2</span>)) <span class="op">/</span> <span class="fl">2</span></span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true" tabindex="-1"></a><span class="fu">ex</span>(𝐚 <span class="op">=&gt;</span> <span class="fl">1</span>, 𝐛<span class="op">=&gt;</span><span class="fl">1</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="22">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\frac{\pi}{12}
\]
</span>
</div>
</div>
<section id="example-5" class="level6">
<h6 class="anchored" data-anchor-id="example-5">Example</h6>
<p>Pascals <a href="http://www-history.mcs.st-and.ac.uk/Curves/Limacon.html">limacon</a> is like the cardioid, but contains an extra loop. When <span class="math inline">\(a=1\)</span> and <span class="math inline">\(b=1\)</span> we have this graph.</p>
<div class="cell" data-hold="true" data-execution_count="22">
<div class="cell-output cell-output-display" data-execution_count="23">
<p><img src="polar_coordinates_files/figure-html/cell-23-output-1.svg" class="img-fluid"></p>
</div>
</div>
<p>What is the area contained in the outer loop, that is not in the inner loop?</p>
<p>To answer, we need to find out what range of values in <span class="math inline">\([0, 2\pi]\)</span> the inner and outer loops are traced. This will be when <span class="math inline">\(r(\theta) = 0\)</span>, which for the choice of <span class="math inline">\(a\)</span> and <span class="math inline">\(b\)</span> solves <span class="math inline">\(1 + 2\cos(\theta) = 0\)</span>, or <span class="math inline">\(\cos(\theta) = -1/2\)</span>. This is <span class="math inline">\(\pi/2 + \pi/6\)</span> and <span class="math inline">\(3\pi/2 - \pi/6\)</span>. The inner loop is traversed between those values and has area:</p>
<div class="cell" data-execution_count="23">
<div class="sourceCode cell-code" id="cb19"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> 𝖺 𝖻 𝗍heta</span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a><span class="fu">𝗋</span>(theta) <span class="op">=</span> 𝖻 <span class="op">+</span> <span class="fl">2</span><span class="fu">𝖺*cos</span>(𝗍heta)</span>
<span id="cb19-3"><a href="#cb19-3" aria-hidden="true" tabindex="-1"></a>𝖾x <span class="op">=</span> <span class="fu">integrate</span>(<span class="fu">𝗋</span>(𝗍heta)<span class="op">^</span><span class="fl">2</span> <span class="op">/</span> <span class="fl">2</span>, (𝗍heta, PI<span class="op">/</span><span class="fl">2</span> <span class="op">+</span> PI<span class="op">/</span><span class="fl">6</span>, <span class="fl">3</span>PI<span class="op">/</span><span class="fl">2</span> <span class="op">-</span> PI<span class="op">/</span><span class="fl">6</span>))</span>
<span id="cb19-4"><a href="#cb19-4" aria-hidden="true" tabindex="-1"></a>𝗂nner <span class="op">=</span> <span class="fu">𝖾x</span>(𝖺<span class="op">=&gt;</span><span class="fl">1</span>, 𝖻<span class="op">=&gt;</span><span class="fl">1</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="24">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\pi - \frac{3 \sqrt{3}}{2}
\]
</span>
</div>
</div>
<p>The outer area (including the inner loop) is the integral from <span class="math inline">\(0\)</span> to <span class="math inline">\(\pi/2 + \pi/6\)</span> plus that from <span class="math inline">\(3\pi/2 - \pi/6\)</span> to <span class="math inline">\(2\pi\)</span>. These areas are equal, so we double the first:</p>
<div class="cell" data-execution_count="24">
<div class="sourceCode cell-code" id="cb20"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a>𝖾x1 <span class="op">=</span> <span class="fl">2</span> <span class="op">*</span> <span class="fu">integrate</span>(<span class="fu">𝗋</span>(𝗍heta)<span class="op">^</span><span class="fl">2</span> <span class="op">/</span> <span class="fl">2</span>, (𝗍heta, <span class="fl">0</span>, PI<span class="op">/</span><span class="fl">2</span> <span class="op">+</span> PI<span class="op">/</span><span class="fl">6</span>))</span>
<span id="cb20-2"><a href="#cb20-2" aria-hidden="true" tabindex="-1"></a>𝗈uter <span class="op">=</span> <span class="fu">𝖾x1</span>(𝖺<span class="op">=&gt;</span><span class="fl">1</span>, 𝖻<span class="op">=&gt;</span><span class="fl">1</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="25">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\frac{3 \sqrt{3}}{2} + 2 \pi
\]
</span>
</div>
</div>
<p>The answer is the difference:</p>
<div class="cell" data-execution_count="25">
<div class="sourceCode cell-code" id="cb21"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a>𝗈uter <span class="op">-</span> 𝗂nner</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="26">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
\pi + 3 \sqrt{3}
\]
</span>
</div>
</div>
</section>
</section>
</section>
<section id="arc-length" class="level2" data-number="52.4">
<h2 data-number="52.4" class="anchored" data-anchor-id="arc-length"><span class="header-section-number">52.4</span> Arc length</h2>
<p>The length of the arc traced by a polar graph can also be expressed using an integral. Again, we partition the interval <span class="math inline">\([a,b]\)</span> and consider the wedge from <span class="math inline">\((r(t_{i-1}), t_{i-1})\)</span> to <span class="math inline">\((r(t_i), t_i)\)</span>. The curve this wedge approximates will have its arc length approximated by the line segment connecting the points. Expressing the points in Cartesian coordinates and simplifying gives the distance squared as:</p>
<p><span class="math display">\[
\begin{align}
d_i^2 &amp;= (r(t_i) \cos(t_i) - r(t_{i-1})\cos(t_{i-1}))^2 + (r(t_i) \sin(t_i) - r(t_{i-1})\sin(t_{i-1}))^2\\
&amp;= r(t_i)^2 - 2r(t_i)r(t_{i-1}) \cos(t_i - t_{i-1}) + r(t_{i-1})^2 \\
&amp;\approx r(t_i)^2 - 2r(t_i)r(t_{i-1}) (1 - \frac{(t_i - t_{i-1})^2}{2})+ r(t_{i-1})^2 \quad(\text{as} \cos(x) \approx 1 - x^2/2)\\
&amp;= (r(t_i) - r(t_{i-1}))^2 + r(t_i)r(t_{i-1}) (t_i - t_{i-1})^2.
\end{align}
\]</span></p>
<p>As was done with arc length we multiply <span class="math inline">\(d_i\)</span> by <span class="math inline">\((t_i - t_{i-1})/(t_i - t_{i-1})\)</span> and move the bottom factor under the square root:</p>
<p><span class="math display">\[
\begin{align}
d_i
&amp;= d_i \frac{t_i - t_{i-1}}{t_i - t_{i-1}} \\
&amp;\approx \sqrt{\frac{(r(t_i) - r(t_{i-1}))^2}{(t_i - t_{i-1})^2} +
\frac{r(t_i)r(t_{i-1}) (t_i - t_{i-1})^2}{(t_i - t_{i-1})^2}} \cdot (t_i - t_{i-1})\\
&amp;= \sqrt{(r'(\xi_i))^2 + r(t_i)r(t_{i-1})} \cdot (t_i - t_{i-1}).\quad(\text{the mean value theorem})
\end{align}
\]</span></p>
<p>Adding the approximations to the <span class="math inline">\(d_i\)</span> looks like a Riemann sum approximation to the integral <span class="math inline">\(\int_a^b \sqrt{(r'(\theta)^2) + r(\theta)^2} d\theta\)</span> (with the extension to the Riemann sum formula needed to derive the arc length for a parameterized curve). That is:</p>
<blockquote class="blockquote">
<p><em>Arc length of a polar curve</em>. The arc length of the curve described in polar coordinates by <span class="math inline">\(r(\theta)\)</span> for <span class="math inline">\(a \leq \theta \leq b\)</span> is given by:</p>
<p><span class="math inline">\(\int_a^b \sqrt{r'(\theta)^2 + r(\theta)^2} d\theta.\)</span></p>
</blockquote>
<p>We test this out on a circle with <span class="math inline">\(r(\theta) = R\)</span>, a constant. The integrand simplifies to just <span class="math inline">\(\sqrt{R^2}\)</span> and the integral is from <span class="math inline">\(0\)</span> to <span class="math inline">\(2\pi\)</span>, so the arc length is <span class="math inline">\(2\pi R\)</span>, precisely the formula for the circumference.</p>
<section id="example-6" class="level5">
<h5 class="anchored" data-anchor-id="example-6">Example</h5>
<p>A cardioid is described by <span class="math inline">\(r(\theta) = 2(1 + \cos(\theta))\)</span>. What is the arc length from <span class="math inline">\(0\)</span> to <span class="math inline">\(2\pi\)</span>?</p>
<p>The integrand is integrable with antiderivative <span class="math inline">\(4\sqrt{2\cos(\theta) + 2} \cdot \tan(\theta/2)\)</span>, but <code>SymPy</code> isnt able to find the integral. Instead we give a numeric answer:</p>
<div class="cell" data-hold="true" data-execution_count="26">
<div class="sourceCode cell-code" id="cb22"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(theta) <span class="op">=</span> <span class="fl">2</span><span class="fu">*</span>(<span class="fl">1</span> <span class="op">+</span> <span class="fu">cos</span>(theta))</span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a><span class="fu">quadgk</span>(t <span class="op">-&gt;</span> <span class="fu">sqrt</span>(r<span class="op">'</span>(t)<span class="op">^</span><span class="fl">2</span> <span class="op">+</span> <span class="fu">r</span>(t)<span class="op">^</span><span class="fl">2</span>), <span class="fl">0</span>, <span class="fl">2</span>pi)[<span class="fl">1</span>]</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="27">
<pre><code>16.0</code></pre>
</div>
</div>
</section>
<section id="example-7" class="level5">
<h5 class="anchored" data-anchor-id="example-7">Example</h5>
<p>The <a href="http://www-history.mcs.st-and.ac.uk/Curves/Equiangular.html">equiangular</a> spiral has polar representation</p>
<p><span class="math display">\[
r(\theta) = a e^{\theta \cot(b)}
\]</span></p>
<p>With <span class="math inline">\(a=1\)</span> and <span class="math inline">\(b=\pi/4\)</span>, find the arc length traced out from <span class="math inline">\(\theta=0\)</span> to <span class="math inline">\(\theta=1\)</span>.</p>
<div class="cell" data-hold="true" data-execution_count="27">
<div class="sourceCode cell-code" id="cb24"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a>a, b <span class="op">=</span> <span class="fl">1</span>, PI<span class="op">/</span><span class="fl">4</span></span>
<span id="cb24-2"><a href="#cb24-2" aria-hidden="true" tabindex="-1"></a><span class="pp">@syms</span> θ</span>
<span id="cb24-3"><a href="#cb24-3" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(theta) <span class="op">=</span> a <span class="op">*</span> <span class="fu">exp</span>(theta <span class="op">*</span> <span class="fu">cot</span>(b))</span>
<span id="cb24-4"><a href="#cb24-4" aria-hidden="true" tabindex="-1"></a>ds <span class="op">=</span> <span class="fu">sqrt</span>(<span class="fu">diff</span>(<span class="fu">r</span>(θ), θ)<span class="op">^</span><span class="fl">2</span> <span class="op">+</span> <span class="fu">r</span>(θ)<span class="op">^</span><span class="fl">2</span>)</span>
<span id="cb24-5"><a href="#cb24-5" aria-hidden="true" tabindex="-1"></a><span class="fu">integrate</span>(ds, (θ, <span class="fl">0</span>, <span class="fl">1</span>))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="28">
<span class="math-left-align" style="padding-left: 4px; width:0; float:left;">
\[
- \sqrt{2} + \sqrt{2} e
\]
</span>
</div>
</div>
</section>
<section id="example-8" class="level5">
<h5 class="anchored" data-anchor-id="example-8">Example</h5>
<p>An Archimedean <a href="http://en.wikipedia.org/wiki/Archimedean_spiral">spiral</a> is defined in polar form by</p>
<p><span class="math display">\[
r(\theta) = a + b \theta
\]</span></p>
<p>That is, the radius increases linearly. The crossings of the positive <span class="math inline">\(x\)</span> axis occur at <span class="math inline">\(a + b n 2\pi\)</span>, so are evenly spaced out by <span class="math inline">\(2\pi b\)</span>. These could be a model for such things as coils of materials of uniform thickness.</p>
<p>For example, a roll of toilet paper promises <span class="math inline">\(1000\)</span> sheets with the <a href="http://www.phlmetropolis.com/2011/03/the-incredible-shrinking-toilet-paper.php">smaller</a> <span class="math inline">\(4.1 \times 3.7\)</span> inch size. This <span class="math inline">\(3700\)</span> inch long connected sheet of paper is wrapped around a paper tube in an Archimedean spiral with <span class="math inline">\(r(\theta) = d_{\text{inner}}/2 + b\theta\)</span>. The entire roll must fit in a standard dimension, so the outer diameter will be <span class="math inline">\(d_{\text{outer}} = 5~1/4\)</span> inches. Can we figure out <span class="math inline">\(b\)</span>?</p>
<p>Let <span class="math inline">\(n\)</span> be the number of windings and assume the starting and ending point is on the positive <span class="math inline">\(x\)</span> axis, <span class="math inline">\(r(2\pi n) = d_{\text{outer}}/2 = d_{\text{inner}}/2 + b (2\pi n)\)</span>. Solving for <span class="math inline">\(n\)</span> in terms of <span class="math inline">\(b\)</span> we get: <span class="math inline">\(n = ( d_{\text{outer}} - d_{\text{inner}})/2 / (2\pi b)\)</span>. With this, the following must hold as the total arc length is <span class="math inline">\(3700\)</span> inches.</p>
<p><span class="math display">\[
\int_0^{n\cdot 2\pi} \sqrt{r(\theta)^2 + r'(\theta)^2} d\theta = 3700
\]</span></p>
<p>Numerically then we have:</p>
<div class="cell" data-hold="true" data-execution_count="28">
<div class="sourceCode cell-code" id="cb25"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a>dinner <span class="op">=</span> <span class="fl">1</span> <span class="op">+</span> <span class="fl">5</span><span class="op">/</span><span class="fl">8</span></span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a>douter <span class="op">=</span> <span class="fl">5</span> <span class="op">+</span> <span class="fl">1</span><span class="op">/</span><span class="fl">4</span></span>
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true" tabindex="-1"></a><span class="fu">r</span>(b,t) <span class="op">=</span> dinner<span class="op">/</span><span class="fl">2</span> <span class="op">+</span> b<span class="op">*</span>t</span>
<span id="cb25-4"><a href="#cb25-4" aria-hidden="true" tabindex="-1"></a><span class="fu">rp</span>(b,t) <span class="op">=</span> b</span>
<span id="cb25-5"><a href="#cb25-5" aria-hidden="true" tabindex="-1"></a><span class="fu">integrand</span>(b,t) <span class="op">=</span> <span class="fu">sqrt</span>((<span class="fu">r</span>(b,t))<span class="op">^</span><span class="fl">2</span> <span class="op">+</span> <span class="fu">rp</span>(b,t)<span class="op">^</span><span class="fl">2</span>) <span class="co"># sqrt(r^2 + r'^2)</span></span>
<span id="cb25-6"><a href="#cb25-6" aria-hidden="true" tabindex="-1"></a><span class="fu">n</span>(b) <span class="op">=</span> (douter <span class="op">-</span> dinner)<span class="op">/</span><span class="fl">2</span><span class="op">/</span>(<span class="fl">2</span><span class="op">*</span><span class="cn">pi</span><span class="op">*</span>b)</span>
<span id="cb25-7"><a href="#cb25-7" aria-hidden="true" tabindex="-1"></a>b <span class="op">=</span> <span class="fu">find_zero</span>(b <span class="op">-&gt;</span> <span class="fu">quadgk</span>(<span class="fu">t-&gt;integrand</span>(b,t), <span class="fl">0</span>, <span class="fu">n</span>(b)<span class="op">*</span><span class="fl">2</span><span class="op">*</span><span class="cn">pi</span>)[<span class="fl">1</span>] <span class="op">-</span> <span class="fl">3700</span>, (<span class="fl">1</span><span class="op">/</span><span class="fl">100000</span>, <span class="fl">1</span><span class="op">/</span><span class="fl">100</span>))</span>
<span id="cb25-8"><a href="#cb25-8" aria-hidden="true" tabindex="-1"></a>b, b<span class="op">*</span><span class="fl">25.4</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="29">
<pre><code>(0.0008419553488281331, 0.02138566586023458)</code></pre>
</div>
</div>
<p>The value <code>b</code> gives a value in inches, the latter in millimeters.</p>
</section>
</section>
<section id="questions" class="level2" data-number="52.5">
<h2 data-number="52.5" class="anchored" data-anchor-id="questions"><span class="header-section-number">52.5</span> Questions</h2>
<section id="question" class="level6">
<h6 class="anchored" data-anchor-id="question">Question</h6>
<p>Let <span class="math inline">\(r=3\)</span> and <span class="math inline">\(\theta=\pi/8\)</span>. In Cartesian coordinates what is <span class="math inline">\(x\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="29">
<div class="cell-output cell-output-display" data-execution_count="30">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="8951134054362922664" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_8951134054362922664">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="8951134054362922664" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="8951134054362922664_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("8951134054362922664").addEventListener("change", function() {
var correct = (Math.abs(this.value - 2.77163859753386) <= 0.001);
var msgBox = document.getElementById('8951134054362922664_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_8951134054362922664")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_8951134054362922664")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
<p>What is <span class="math inline">\(y\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="30">
<div class="cell-output cell-output-display" data-execution_count="31">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="5761455272996855278" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_5761455272996855278">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="5761455272996855278" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="5761455272996855278_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("5761455272996855278").addEventListener("change", function() {
var correct = (Math.abs(this.value - 1.1480502970952693) <= 0.001);
var msgBox = document.getElementById('5761455272996855278_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_5761455272996855278")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_5761455272996855278")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-1" class="level6">
<h6 class="anchored" data-anchor-id="question-1">Question</h6>
<p>A point in Cartesian coordinates is given by <span class="math inline">\((-12, -5)\)</span>. In has a polar coordinate representation with an angle <span class="math inline">\(\theta\)</span> in <span class="math inline">\([0,2\pi]\)</span> and <span class="math inline">\(r &gt; 0\)</span>. What is <span class="math inline">\(r\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="31">
<div class="cell-output cell-output-display" data-execution_count="32">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="13790682733778224365" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_13790682733778224365">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="13790682733778224365" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="13790682733778224365_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("13790682733778224365").addEventListener("change", function() {
var correct = (Math.abs(this.value - 13.0) <= 0.001);
var msgBox = document.getElementById('13790682733778224365_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_13790682733778224365")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_13790682733778224365")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
<p>What is <span class="math inline">\(\theta\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="32">
<div class="cell-output cell-output-display" data-execution_count="33">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="5804366881865167915" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_5804366881865167915">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="5804366881865167915" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="5804366881865167915_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("5804366881865167915").addEventListener("change", function() {
var correct = (Math.abs(this.value - -2.746801533890032) <= 0.001);
var msgBox = document.getElementById('5804366881865167915_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_5804366881865167915")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_5804366881865167915")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-2" class="level6">
<h6 class="anchored" data-anchor-id="question-2">Question</h6>
<p>Does <span class="math inline">\(r(\theta) = a \sec(\theta - \gamma)\)</span> describe a line for <span class="math inline">\(0\)</span> when <span class="math inline">\(a=3\)</span> and <span class="math inline">\(\gamma=\pi/4\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="33">
<div class="cell-output cell-output-display" data-execution_count="34">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="51804261971404991" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_51804261971404991">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_51804261971404991_1">
<input class="form-check-input" type="radio" name="radio_51804261971404991" id="radio_51804261971404991_1" value="1">
<span class="label-body px-1">
Yes
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_51804261971404991_2">
<input class="form-check-input" type="radio" name="radio_51804261971404991" id="radio_51804261971404991_2" value="2">
<span class="label-body px-1">
No
</span>
</label>
</div>
</div>
</div>
<div id="51804261971404991_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_51804261971404991"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('51804261971404991_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_51804261971404991")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_51804261971404991")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>If yes, what is the <span class="math inline">\(y\)</span> intercept</p>
<div class="cell" data-hold="true" data-execution_count="34">
<div class="cell-output cell-output-display" data-execution_count="35">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="13949325991897814993" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_13949325991897814993">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="13949325991897814993" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="13949325991897814993_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("13949325991897814993").addEventListener("change", function() {
var correct = (Math.abs(this.value - 4.242640687119285) <= 0.001);
var msgBox = document.getElementById('13949325991897814993_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_13949325991897814993")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_13949325991897814993")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
<p>What is slope of the line?</p>
<div class="cell" data-hold="true" data-execution_count="35">
<div class="cell-output cell-output-display" data-execution_count="36">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="2606072756958071813" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_2606072756958071813">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="2606072756958071813" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="2606072756958071813_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("2606072756958071813").addEventListener("change", function() {
var correct = (Math.abs(this.value - -1.0) <= 0.001);
var msgBox = document.getElementById('2606072756958071813_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_2606072756958071813")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_2606072756958071813")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
<p>Does this seem likely: the slope is <span class="math inline">\(-1/\tan(\gamma)\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="36">
<div class="cell-output cell-output-display" data-execution_count="37">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="18159700403392207843" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_18159700403392207843">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_18159700403392207843_1">
<input class="form-check-input" type="radio" name="radio_18159700403392207843" id="radio_18159700403392207843_1" value="1">
<span class="label-body px-1">
Yes
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_18159700403392207843_2">
<input class="form-check-input" type="radio" name="radio_18159700403392207843" id="radio_18159700403392207843_2" value="2">
<span class="label-body px-1">
No
</span>
</label>
</div>
</div>
</div>
<div id="18159700403392207843_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_18159700403392207843"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('18159700403392207843_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_18159700403392207843")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_18159700403392207843")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-3" class="level6">
<h6 class="anchored" data-anchor-id="question-3">Question</h6>
<p>The polar curve <span class="math inline">\(r(\theta) = 2\cos(\theta)\)</span> has tangent lines at most points. This differential representation of the chain rule</p>
<p><span class="math display">\[
\frac{dy}{dx} = \frac{dy}{d\theta} / \frac{dx}{d\theta},
\]</span></p>
<p>allows the slope to be computed when <span class="math inline">\(y\)</span> and <span class="math inline">\(x\)</span> are the Cartesian form of the polar curve. For this curve, we have</p>
<p><span class="math display">\[
\frac{dy}{d\theta} = \frac{d}{d\theta}(2\cos(\theta) \cdot \cos(\theta)),~ \text{ and }
\frac{dx}{d\theta} = \frac{d}{d\theta}(2\sin(\theta) \cdot \cos(\theta)).
\]</span></p>
<p>Numerically, what is the slope of the tangent line when <span class="math inline">\(\theta = \pi/4\)</span>?</p>
<div class="cell" data-hold="true" data-execution_count="37">
<div class="cell-output cell-output-display" data-execution_count="38">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="12953290431719225031" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_12953290431719225031">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="12953290431719225031" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="12953290431719225031_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("12953290431719225031").addEventListener("change", function() {
var correct = (Math.abs(this.value - -4.503599627370496e15) <= 0.001);
var msgBox = document.getElementById('12953290431719225031_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_12953290431719225031")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_12953290431719225031")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-4" class="level6">
<h6 class="anchored" data-anchor-id="question-4">Question</h6>
<p>For different values <span class="math inline">\(k &gt; 0\)</span> and <span class="math inline">\(e &gt; 0\)</span> the polar equation</p>
<p><span class="math display">\[
r(\theta) = \frac{ke}{1 + e\cos(\theta)}
\]</span></p>
<p>has a familiar form. The value of <span class="math inline">\(k\)</span> is just a scale factor, but different values of <span class="math inline">\(e\)</span> yield different shapes.</p>
<p>When <span class="math inline">\(0 &lt; e &lt; 1\)</span> what is the shape of the curve? (Answer by making a plot and guessing.)</p>
<div class="cell" data-hold="true" data-execution_count="38">
<div class="cell-output cell-output-display" data-execution_count="39">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="5951443184311074435" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_5951443184311074435">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_5951443184311074435_1">
<input class="form-check-input" type="radio" name="radio_5951443184311074435" id="radio_5951443184311074435_1" value="1">
<span class="label-body px-1">
an ellipse
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_5951443184311074435_2">
<input class="form-check-input" type="radio" name="radio_5951443184311074435" id="radio_5951443184311074435_2" value="2">
<span class="label-body px-1">
a parabola
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_5951443184311074435_3">
<input class="form-check-input" type="radio" name="radio_5951443184311074435" id="radio_5951443184311074435_3" value="3">
<span class="label-body px-1">
a hyperbola
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_5951443184311074435_4">
<input class="form-check-input" type="radio" name="radio_5951443184311074435" id="radio_5951443184311074435_4" value="4">
<span class="label-body px-1">
a circle
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_5951443184311074435_5">
<input class="form-check-input" type="radio" name="radio_5951443184311074435" id="radio_5951443184311074435_5" value="5">
<span class="label-body px-1">
a line
</span>
</label>
</div>
</div>
</div>
<div id="5951443184311074435_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_5951443184311074435"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('5951443184311074435_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_5951443184311074435")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_5951443184311074435")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>When <span class="math inline">\(e = 1\)</span> what is the shape of the curve?</p>
<div class="cell" data-hold="true" data-execution_count="39">
<div class="cell-output cell-output-display" data-execution_count="40">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="12437284084084891574" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_12437284084084891574">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_12437284084084891574_1">
<input class="form-check-input" type="radio" name="radio_12437284084084891574" id="radio_12437284084084891574_1" value="1">
<span class="label-body px-1">
an ellipse
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12437284084084891574_2">
<input class="form-check-input" type="radio" name="radio_12437284084084891574" id="radio_12437284084084891574_2" value="2">
<span class="label-body px-1">
a parabola
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12437284084084891574_3">
<input class="form-check-input" type="radio" name="radio_12437284084084891574" id="radio_12437284084084891574_3" value="3">
<span class="label-body px-1">
a hyperbola
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12437284084084891574_4">
<input class="form-check-input" type="radio" name="radio_12437284084084891574" id="radio_12437284084084891574_4" value="4">
<span class="label-body px-1">
a circle
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_12437284084084891574_5">
<input class="form-check-input" type="radio" name="radio_12437284084084891574" id="radio_12437284084084891574_5" value="5">
<span class="label-body px-1">
a line
</span>
</label>
</div>
</div>
</div>
<div id="12437284084084891574_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_12437284084084891574"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 2;
var msgBox = document.getElementById('12437284084084891574_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_12437284084084891574")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_12437284084084891574")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
<p>When <span class="math inline">\(1 &lt; e\)</span> what is the shape of the curve?</p>
<div class="cell" data-hold="true" data-execution_count="40">
<div class="cell-output cell-output-display" data-execution_count="41">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="13796574889004756738" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_13796574889004756738">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_13796574889004756738_1">
<input class="form-check-input" type="radio" name="radio_13796574889004756738" id="radio_13796574889004756738_1" value="1">
<span class="label-body px-1">
an ellipse
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_13796574889004756738_2">
<input class="form-check-input" type="radio" name="radio_13796574889004756738" id="radio_13796574889004756738_2" value="2">
<span class="label-body px-1">
a parabola
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_13796574889004756738_3">
<input class="form-check-input" type="radio" name="radio_13796574889004756738" id="radio_13796574889004756738_3" value="3">
<span class="label-body px-1">
a hyperbola
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_13796574889004756738_4">
<input class="form-check-input" type="radio" name="radio_13796574889004756738" id="radio_13796574889004756738_4" value="4">
<span class="label-body px-1">
a circle
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_13796574889004756738_5">
<input class="form-check-input" type="radio" name="radio_13796574889004756738" id="radio_13796574889004756738_5" value="5">
<span class="label-body px-1">
a line
</span>
</label>
</div>
</div>
</div>
<div id="13796574889004756738_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_13796574889004756738"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 3;
var msgBox = document.getElementById('13796574889004756738_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_13796574889004756738")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_13796574889004756738")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-5" class="level6">
<h6 class="anchored" data-anchor-id="question-5">Question</h6>
<p>Find the area of a lobe of the <a href="http://www-history.mcs.st-and.ac.uk/Curves/Lemniscate.html">lemniscate</a> curve traced out by <span class="math inline">\(r(\theta) = \sqrt{\cos(2\theta)}\)</span> between <span class="math inline">\(-\pi/4\)</span> and <span class="math inline">\(\pi/4\)</span>. What is the answer?</p>
<div class="cell" data-hold="true" data-execution_count="41">
<div class="cell-output cell-output-display" data-execution_count="42">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="10503185713710080631" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_10503185713710080631">
<div style="padding-top: 5px">
<div class="form-check">
<label class="form-check-label" for="radio_10503185713710080631_1">
<input class="form-check-input" type="radio" name="radio_10503185713710080631" id="radio_10503185713710080631_1" value="1">
<span class="label-body px-1">
\(1/2\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10503185713710080631_2">
<input class="form-check-input" type="radio" name="radio_10503185713710080631" id="radio_10503185713710080631_2" value="2">
<span class="label-body px-1">
\(\pi/2\)
</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="radio_10503185713710080631_3">
<input class="form-check-input" type="radio" name="radio_10503185713710080631" id="radio_10503185713710080631_3" value="3">
<span class="label-body px-1">
\(1\)
</span>
</label>
</div>
</div>
</div>
<div id="10503185713710080631_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.querySelectorAll('input[name="radio_10503185713710080631"]').forEach(function(rb) {
rb.addEventListener("change", function() {
var correct = rb.value == 1;
var msgBox = document.getElementById('10503185713710080631_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_10503185713710080631")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_10503185713710080631")
if (explanation != null) {
explanation.style.display = "block";
}
}
})});
</script>
</div>
</div>
</section>
<section id="question-6" class="level6">
<h6 class="anchored" data-anchor-id="question-6">Question</h6>
<p>Find the area of a lobe of the <a href="http://www-history.mcs.st-and.ac.uk/Curves/Eight.html">eight</a> curve traced out by <span class="math inline">\(r(\theta) = \cos(2\theta)\sec(\theta)^4\)</span> from <span class="math inline">\(-\pi/4\)</span> to <span class="math inline">\(\pi/4\)</span>. Do this numerically.</p>
<div class="cell" data-hold="true" data-execution_count="42">
<div class="cell-output cell-output-display" data-execution_count="43">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="3864223870362414104" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_3864223870362414104">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="3864223870362414104" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="3864223870362414104_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("3864223870362414104").addEventListener("change", function() {
var correct = (Math.abs(this.value - 0.6666666666666666) <= 0.001);
var msgBox = document.getElementById('3864223870362414104_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_3864223870362414104")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_3864223870362414104")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-7" class="level6">
<h6 class="anchored" data-anchor-id="question-7">Question</h6>
<p>Find the arc length of a lobe of the <a href="http://www-history.mcs.st-and.ac.uk/Curves/Lemniscate.html">lemniscate</a> curve traced out by <span class="math inline">\(r(\theta) = \sqrt{\cos(2\theta)}\)</span> between <span class="math inline">\(-\pi/4\)</span> and <span class="math inline">\(\pi/4\)</span>. What is the answer (numerically)?</p>
<div class="cell" data-hold="true" data-execution_count="43">
<div class="cell-output cell-output-display" data-execution_count="44">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="6872586307706525972" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_6872586307706525972">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="6872586307706525972" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="6872586307706525972_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("6872586307706525972").addEventListener("change", function() {
var correct = (Math.abs(this.value - 2.622057529756253) <= 0.001);
var msgBox = document.getElementById('6872586307706525972_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_6872586307706525972")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_6872586307706525972")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
<section id="question-8" class="level6">
<h6 class="anchored" data-anchor-id="question-8">Question</h6>
<p>Find the arc length of a lobe of the <a href="http://www-history.mcs.st-and.ac.uk/Curves/Eight.html">eight</a> curve traced out by <span class="math inline">\(r(\theta) = \cos(2\theta)\sec(\theta)^4\)</span> from <span class="math inline">\(-\pi/4\)</span> to <span class="math inline">\(\pi/4\)</span>. Do this numerically.</p>
<div class="cell" data-hold="true" data-execution_count="44">
<div class="cell-output cell-output-display" data-execution_count="45">
<form class="mx-2 my-3 mw-100" name="WeaveQuestion" data-id="10336995485639264543" data-controltype="">
<div class="form-group ">
<div class="controls">
<div class="form" id="controls_10336995485639264543">
<div style="padding-top: 5px">
<br>
<div class="input-group">
<input id="10336995485639264543" type="number" class="form-control" placeholder="Numeric answer">
</div>
</div>
</div>
<div id="10336995485639264543_message" style="padding-bottom: 15px"></div>
</div>
</div>
</form>
<script text="text/javascript">
document.getElementById("10336995485639264543").addEventListener("change", function() {
var correct = (Math.abs(this.value - 3.048611692422249) <= 0.001);
var msgBox = document.getElementById('10336995485639264543_message');
if(correct) {
msgBox.innerHTML = "<div class='pluto-output admonition note alert alert-success'><span> 👍&nbsp; Correct </span></div>";
var explanation = document.getElementById("explanation_10336995485639264543")
if (explanation != null) {
explanation.style.display = "none";
}
} else {
msgBox.innerHTML = "<div class='pluto-output admonition alert alert-danger'><span>👎&nbsp; Incorrect </span></div>";
var explanation = document.getElementById("explanation_10336995485639264543")
if (explanation != null) {
explanation.style.display = "block";
}
}
});
</script>
</div>
</div>
</section>
</section>
</main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
const mode = bsSheetEl.getAttribute("data-mode");
const bodyEl = window.document.querySelector("body");
if (mode === "dark") {
bodyEl.classList.add("quarto-dark");
bodyEl.classList.remove("quarto-light");
} else {
bodyEl.classList.add("quarto-light");
bodyEl.classList.remove("quarto-dark");
}
}
const toggleBodyColorPrimary = () => {
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
if (bsSheetEl) {
toggleBodyColorMode(bsSheetEl);
}
}
toggleBodyColorPrimary();
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
placement: 'right',
icon: icon
};
anchorJS.add('.anchored');
const clipboard = new window.ClipboardJS('.code-copy-button', {
target: function(trigger) {
return trigger.previousElementSibling;
}
});
clipboard.on('success', function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked"
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
setTimeout(function() {
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
});
function tippyHover(el, contentFn) {
const config = {
allowHTML: true,
content: contentFn,
maxWidth: 500,
delay: 100,
arrow: false,
appendTo: function(el) {
return el.parentElement;
},
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start'
};
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
for (var i=0; i<noterefs.length; i++) {
const ref = noterefs[i];
tippyHover(ref, function() {
let href = ref.getAttribute('href');
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
return note.innerHTML;
});
}
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
for (var i=0; i<bibliorefs.length; i++) {
const ref = bibliorefs[i];
const cites = ref.parentNode.getAttribute('data-cites').split(' ');
tippyHover(ref, function() {
var popup = window.document.createElement('div');
cites.forEach(function(cite) {
var citeDiv = window.document.createElement('div');
citeDiv.classList.add('hanging-indent');
citeDiv.classList.add('csl-entry');
var biblioDiv = window.document.getElementById('ref-' + cite);
if (biblioDiv) {
citeDiv.innerHTML = biblioDiv.innerHTML;
}
popup.appendChild(citeDiv);
});
return popup.innerHTML;
});
}
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
var filterRegex = new RegExp('/' + window.location.host + '/');
var isInternal = (href) => {
return filterRegex.test(href) || localhostRegex.test(href);
}
// Inspect non-navigation links and adorn them if external
var links = window.document.querySelectorAll('a:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external)');
for (var i=0; i<links.length; i++) {
const link = links[i];
if (!isInternal(link.href)) {
// target, if specified
link.setAttribute("target", "_blank");
}
}
});
</script>
<nav class="page-navigation">
<div class="nav-page nav-page-previous">
<a href="../ODEs/differential_equations.html" class="pagination-link">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">51</span>&nbsp; <span class="chapter-title">The <code>DifferentialEquations</code> suite</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
<a href="../differentiable_vector_calculus/vectors.html" class="pagination-link">
<span class="nav-page-text"><span class="chapter-number">53</span>&nbsp; <span class="chapter-title">Vectors and matrices</span></span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>
</div> <!-- /content -->
<footer class="footer">
<div class="nav-footer">
<div class="nav-footer-center">Copyright 2022, John Verzani</div>
</div>
</footer>
</body></html>