add parametric equations for hypotrochoid

This commit is contained in:
2019-11-01 14:25:53 +01:00
parent f8b9cddfa6
commit 254fa75498
7 changed files with 199 additions and 12 deletions

View File

@@ -34,10 +34,10 @@
<div class="section" id="module-function">
<span id="function-module"></span><h1>function module<a class="headerlink" href="#module-function" title="Permalink to this headline"></a></h1>
<p>Mathematical functions.</p>
<p>Mathematical equations.</p>
<dl class="field-list simple">
<dt class="field-odd">Date</dt>
<dd class="field-odd"><p>2019-10-27</p>
<dd class="field-odd"><p>2019-11-01</p>
</dd>
</dl>
<span class="target" id="module-function"></span><dl class="function">
@@ -56,11 +56,15 @@ lags the cosine.</p>
<li><p><strong>f</strong> (<em>float</em><em> or </em><em>int</em>) ordinary frequency</p></li>
<li><p><strong>phi</strong> (<em>float</em><em> or </em><em>int</em>) phase</p></li>
<li><p><strong>D</strong> (<em>float</em><em> or </em><em>int</em>) non-zero center amplitude</p></li>
<li><p><strong>degree</strong> boolean to switch between radians and degree. If
<li><p><strong>degree</strong> (<em>bool</em>) boolean to switch between radians and degree. If
False phi is interpreted in radians and if True then phi is
interpreted in degrees.</p></li>
</ul>
</dd>
<dt class="field-even">Results</dt>
<dd class="field-even"><p>sine wave function of spatial variable x and optional
time t</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
@@ -68,6 +72,59 @@ interpreted in degrees.</p></li>
</div>
</dd></dl>
<dl class="function">
<dt id="function.hypotrochoid">
<code class="sig-name descname">hypotrochoid</code><span class="sig-paren">(</span><em class="sig-param">R</em>, <em class="sig-param">r</em>, <em class="sig-param">d</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/function.html#hypotrochoid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#function.hypotrochoid" title="Permalink to this definition"></a></dt>
<dd><p>Hypotrochoid</p>
<p>A point is attached with a distance d from the center of a circle
of radius r. The circle is rolling around the inside of a fixed
circle of radius R.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> (<em>float</em>) radius of the fixed exterior circle</p></li>
<li><p><strong>r</strong> radius of the rolling circle inside of the fixed circle</p></li>
<li><p><strong>d</strong> (<em>float</em>) distance from the center of the interior circle</p></li>
</ul>
</dd>
<dt class="field-even">Typre r</dt>
<dd class="field-even"><p>float</p>
</dd>
<dt class="field-odd">Results</dt>
<dd class="field-odd"><p>functions for x of theta and y of theta</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>tuple</p>
</dd>
</dl>
<div class="math notranslate nohighlight">
\[\begin{split}x(\theta) = (R - r)\cos\theta + d\cos\left(\frac{R-r}{r}\theta\right) \\
y(\theta) = (R - r)\sin\theta - d\sin\left(\frac{R-r}{r}\theta\right) \\
\theta = \left[0, 2\pi\frac{\mathrm{lcm}(r, R)}{R}\right]\end{split}\]</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="o">*</span> <span class="o">*</span> <span class="o">*</span>
<span class="o">*</span> <span class="n">R</span> <span class="o">*</span>
<span class="o">*</span> <span class="o">*</span>
<span class="o">*</span> <span class="o">*</span> <span class="o">*</span> <span class="o">*</span>
<span class="o">*</span> <span class="o">*</span> <span class="n">r</span> <span class="o">**</span>
<span class="o">*</span> <span class="o">*</span> <span class="o">....</span> <span class="o">*</span>
<span class="o">*</span> <span class="o">*</span> <span class="n">d</span> <span class="o">*</span>
<span class="o">*</span> <span class="o">*</span> <span class="o">**</span>
<span class="o">*</span> <span class="o">*</span> <span class="o">*</span> <span class="o">*</span>
<span class="o">*</span> <span class="o">*</span>
<span class="o">*</span> <span class="o">*</span>
<span class="o">*</span> <span class="o">*</span> <span class="o">*</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">hyotrochoid</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">6</span><span class="p">)[:</span><span class="mi">1</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">theta_end</span> <span class="o">=</span> <span class="n">hyotrochoid</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">6</span><span class="p">)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="mathematics.html#mathematics.lcm" title="mathematics.lcm"><code class="xref py py-meth docutils literal notranslate"><span class="pre">mathematics.lcm()</span></code></a></p>
</div>
</dd></dl>
<dl class="function">
<dt id="function.sine_wave">
<code class="sig-name descname">sine_wave</code><span class="sig-paren">(</span><em class="sig-param">A=1</em>, <em class="sig-param">k=1</em>, <em class="sig-param">f=1</em>, <em class="sig-param">phi=0</em>, <em class="sig-param">D=0</em>, <em class="sig-param">degree=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/function.html#sine_wave"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#function.sine_wave" title="Permalink to this definition"></a></dt>
@@ -81,11 +138,15 @@ smooth periodic oscillation.</p>
<li><p><strong>f</strong> (<em>float</em><em> or </em><em>int</em>) ordinary frequency</p></li>
<li><p><strong>phi</strong> (<em>float</em><em> or </em><em>int</em>) phase</p></li>
<li><p><strong>D</strong> (<em>float</em><em> or </em><em>int</em>) non-zero center amplitude</p></li>
<li><p><strong>degree</strong> boolean to switch between radians and degree. If
<li><p><strong>degree</strong> (<em>bool</em>) boolean to switch between radians and degree. If
False phi is interpreted in radians and if True then phi is
interpreted in degrees.</p></li>
</ul>
</dd>
<dt class="field-even">Results</dt>
<dd class="field-even"><p>sine wave function of spatial variable x and optional
time t</p>
</dd>
</dl>
<p>In general, the function is:</p>
<div class="math notranslate nohighlight">