add mathematical function to string function for braille and block characters

This commit is contained in:
2019-11-15 16:05:54 +01:00
parent 0041abe8f3
commit 1de007a285
48 changed files with 6987 additions and 82 deletions

View File

@@ -68,7 +68,7 @@ time t</p>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><code class="xref py py-meth docutils literal notranslate"><span class="pre">function_sine_wave_degree()</span></code></p>
<p><a class="reference internal" href="#function.sine_wave" title="function.sine_wave"><code class="xref py py-meth docutils literal notranslate"><span class="pre">sine_wave()</span></code></a></p>
</div>
</dd></dl>
@@ -228,7 +228,136 @@ angular frequency ω and the linear speed (speed of propagation)
linear speed.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><code class="xref py py-meth docutils literal notranslate"><span class="pre">function_cosine_wave_degree()</span></code></p>
<p><a class="reference internal" href="#function.cosine_wave" title="function.cosine_wave"><code class="xref py py-meth docutils literal notranslate"><span class="pre">cosine_wave()</span></code></a></p>
</div>
</dd></dl>
<dl class="function">
<dt id="function.to_str">
<code class="sig-name descname">to_str</code><span class="sig-paren">(</span><em class="sig-param">f</em>, <em class="sig-param">x=None</em>, <em class="sig-param">x_0=0</em>, <em class="sig-param">x_1=1</em>, <em class="sig-param">t=None</em>, <em class="sig-param">h=10</em>, <em class="sig-param">w=80</em>, <em class="sig-param">density=1</em>, <em class="sig-param">char_set='line'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/function.html#to_str"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#function.to_str" title="Permalink to this definition"></a></dt>
<dd><p>Represent functions as string frame with a specific character set.
which are normed to the range of [0, 1] to</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>f</strong> (<em>function</em><em> or </em><em>list</em>) function or list of functions normed to the range of [0, 1]</p></li>
<li><p><strong>h</strong> (<em>int</em>) number of chars in vertical direction</p></li>
<li><p><strong>w</strong> (<em>int</em>) number of chars in horizontal direction</p></li>
<li><p><strong>char_set</strong> (<em>str</em>) either “braille” or “block”. “braille” uses Unicode
Characters in the Braille Patterns Block (fisrt index U+2800, last
index U+28FF <a class="reference internal" href="pylib.html#cudb" id="id1"><span>[CUDB]</span></a>) and the “block” uses part of the Unicode
Characters in the Block Elements Block (fisrt index U+2580, last
index U+259F <a class="reference internal" href="pylib.html#cudb" id="id2"><span>[CUDB]</span></a>). Alias for braille is line and alias for
block is histogram</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>Usage:</dt><dd><ul class="simple">
<li><p>case dependent arguments</p>
<ul>
<li><p>1 quasi line plot (braille characters)
f = lambda function (lambda x, t=0: …)
x_1 = max x value
x_0 = min x value
t = time (animation)</p></li>
<li><p>2 histogram (block characters)
f = lambda function (lambda x, t=0: …)
x_1 = max x value
x_0 = min x value
t = time (animation)
chart=”histogram”</p></li>
</ul>
</li>
<li><p>general arguments
w = window width in number of chars
density = number of data point per pixel (for line chart higher density makes thicker lines)
chart = either “line” or “histogram”</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Braille Patterns Block</p>
<ul class="simple">
<li><p>Dots or pixels per character in vertical direction: 6</p></li>
<li><p>Dots or pixels per character in horizontal direction: 2</p></li>
</ul>
<p>First dot (bottom left) is the zero (0) position of the
function. So, a function value of zero does not mean to have zero
dots but one.
Example of 3 columns and 3 rows (upside down view of normal braille/drawille position)</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> | ^ y axis
| |
| ,_____,,_____,,_____,
7 + | * *|| * *|| * *|
6 + | * *|| * *|| * *|
5 + | * *|| * *|| * *|
4 + | * *|| * *|| * *|
| ;=====;;=====;;=====;
3 + | * *|| * *|| * *|
2 + | * *|| * *|| * *|
1 + | * *|| * *|| * *|
0 + - | * *|| * *|| * *| ---&gt; x axis
| ;=====;;=====;;=====;
-1 + | * *|| * *|| * *|
-2 + | * *|| * *|| * *|
-3 + | * *|| * *|| * *|
-4 + | * *|| * *|| * *|
| `````````````````````
| |
`-----+--+---+--+---+--+-------------
-2 -1 0 1 2 3
</pre></div>
</div>
<p class="rubric">Block Elements Block</p>
<ul class="simple">
<li><p>Dots or pixels per character in vertical direction: 8</p></li>
<li><p>Dots or pixels per character in horizontal direction: 1</p></li>
</ul>
<p>Example of 3 columns and 3 rows</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> | ^ y axis
| |
| ,_____,,_____,,_____,
15 + | --- || --- || --- |
14 + | --- || --- || --- |
13 + | --- || --- || --- |
12 + | --- || --- || --- |
11 + | --- || --- || --- |
10 + | --- || --- || --- |
9 + | --- || --- || --- |
8 + | --- || --- || --- |
| ;=====;;=====;;=====;
7 + | --- || --- || --- |
6 + | --- || --- || --- |
5 + | --- || --- || --- |
4 + | --- || --- || --- |
3 + | --- || --- || --- |
2 + | --- || --- || --- |
1 + | --- || --- || --- |
0 + - | --- || --- || --- | ---&gt; x axis
| ;=====;;=====;;=====;
-1 + | --- || --- || --- |
-2 + | --- || --- || --- |
-3 + | --- || --- || --- |
-4 + | --- || --- || --- |
-5 + | --- || --- || --- |
-6 + | --- || --- || --- |
-7 + | --- || --- || --- |
-8 + | --- || --- || --- |
| `````````````````````
| |
`------+------+------+---------------
-1 0 1
</pre></div>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="cudb"><span class="brackets">CUDB</span><span class="fn-backref">(<a href="#id1">1</a>,<a href="#id2">2</a>)</span></dt>
<dd><p><a class="reference external" href="ftp://ftp.unicode.org/Public/UNIDATA/Blocks.txt">Unicode Database - Blocks</a></p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="pylib.html#pylib.function.transformation" title="pylib.function.transformation"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pylib.function.transformation()</span></code></a></p>
</div>
</dd></dl>
@@ -314,7 +443,7 @@ linear speed.</p>
&copy;2019, Daniel Weschke.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.2.0</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.2.1</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|