Files
pylib/docs/build/html/geometry.html

306 lines
12 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">
<head>
<meta charset="utf-8" />
<title>geometry module &#8212; pylib 2019.5.19 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-geometry">
<span id="geometry-module"></span><h1>geometry module<a class="headerlink" href="#module-geometry" title="Permalink to this headline"></a></h1>
<p>2D geometry objects.</p>
<dl class="field-list simple">
<dt class="field-odd">Date</dt>
<dd class="field-odd"><p>2019-03-21</p>
</dd>
</dl>
<span class="target" id="module-geometry"></span><dl class="function">
<dt id="geometry.cubic">
<code class="descname">cubic</code><span class="sig-paren">(</span><em>point1</em>, <em>angle1</em>, <em>point2</em>, <em>angle2</em>, <em>samples=50</em><span class="sig-paren">)</span><a class="headerlink" href="#geometry.cubic" title="Permalink to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>point1</strong> (<em>tuple</em>) one end point</p></li>
<li><p><strong>angle1</strong> (<em>int</em><em> or </em><em>float</em>) the slope at the one end point</p></li>
<li><p><strong>point2</strong> (<em>tuple</em>) other end point</p></li>
<li><p><strong>angle2</strong> (<em>int</em><em> or </em><em>float</em>) the slope at the other end point</p></li>
<li><p><strong>samples</strong> (<em>int</em>) number of sampling points</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>([sample_point1_x, sample_point2_x, …],
[sample_points1_y, sample_point2_y, …])</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="geometry.cubic_deg">
<code class="descname">cubic_deg</code><span class="sig-paren">(</span><em>point1</em>, <em>angle1</em>, <em>point2</em>, <em>angle2</em><span class="sig-paren">)</span><a class="headerlink" href="#geometry.cubic_deg" title="Permalink to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>point1</strong> (<em>tuple</em>) one end point</p></li>
<li><p><strong>angle1</strong> (<em>int</em><em> or </em><em>float</em>) the slope at the one end point</p></li>
<li><p><strong>point2</strong> (<em>tuple</em>) other end point</p></li>
<li><p><strong>angle2</strong> (<em>int</em><em> or </em><em>float</em>) the slope at the other end point</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>([sample_point1_x, sample_point2_x, …],
[sample_points1_y, sample_point2_y, …])</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#geometry.cubic" title="geometry.cubic"><code class="xref py py-meth docutils literal notranslate"><span class="pre">cubic()</span></code></a></p>
</div>
</dd></dl>
<dl class="function">
<dt id="geometry.line">
<code class="descname">line</code><span class="sig-paren">(</span><em>point1</em>, <em>point2</em>, <em>samples=2</em><span class="sig-paren">)</span><a class="headerlink" href="#geometry.line" title="Permalink to this definition"></a></dt>
<dd><div class="math notranslate nohighlight">
\[y = \frac{y_2-y_1}{x_2-x_1}(x-x_1) + y_1\]</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>point1</strong> (<em>tuple</em>) one end point</p></li>
<li><p><strong>point2</strong> (<em>tuple</em>) other end point</p></li>
<li><p><strong>samples</strong> (<em>int</em>) number of sampling points</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>((point1_x, point2_x), (points1_y, point2_y)) or
([sample_point1_x, sample_point2_x, …],
[sample_points1_y, sample_point2_y, …])</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="geometry.points">
<code class="descname">points</code><span class="sig-paren">(</span><em>*pts</em><span class="sig-paren">)</span><a class="headerlink" href="#geometry.points" title="Permalink to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>*pts</strong> points to rearrange</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>((point1_x, point2_x), (point1_y, point2_y), …)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="geometry.rectangle">
<code class="descname">rectangle</code><span class="sig-paren">(</span><em>width</em>, <em>height</em><span class="sig-paren">)</span><a class="headerlink" href="#geometry.rectangle" title="Permalink to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>width</strong> (<em>int</em><em> or </em><em>float</em>) the width of the rectangle</p></li>
<li><p><strong>height</strong> (<em>int</em><em> or </em><em>float</em>) the height of the rectangle</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(point1, point2, point3, point4)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="geometry.rotate">
<code class="descname">rotate</code><span class="sig-paren">(</span><em>origin</em>, <em>angle</em>, <em>*pts</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#geometry.rotate" title="Permalink to this definition"></a></dt>
<dd><p>Rotate a point or polygon counterclockwise by a given angle around a given
origin. The angle should be given in radians.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>origin</strong> (<em>tuple</em>) the center of rotation</p></li>
<li><p><strong>angle</strong> (<em>int</em><em> or </em><em>float</em>) the rotation angle</p></li>
<li><p><strong>*pts</strong> points to rotate</p></li>
<li><p><strong>**kwargs</strong> options</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(point_x, point_y) or (point1, point2, …)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="geometry.rotate_deg">
<code class="descname">rotate_deg</code><span class="sig-paren">(</span><em>origin</em>, <em>angle</em>, <em>*pts</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#geometry.rotate_deg" title="Permalink to this definition"></a></dt>
<dd><p>Rotate a point or polygon counterclockwise by a given angle around a given
origin. The angle should be given in degrees.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>origin</strong> (<em>tuple</em>) the center of rotation</p></li>
<li><p><strong>angle</strong> (<em>int</em><em> or </em><em>float</em>) the rotation angle</p></li>
<li><p><strong>*pts</strong> points to rotate</p></li>
<li><p><strong>**kwargs</strong> options</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(point_x, point_y) or (point1, point2, …)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#geometry.rotate" title="geometry.rotate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">rotate()</span></code></a></p>
</div>
</dd></dl>
<dl class="function">
<dt id="geometry.square">
<code class="descname">square</code><span class="sig-paren">(</span><em>width</em><span class="sig-paren">)</span><a class="headerlink" href="#geometry.square" title="Permalink to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>width</strong> (<em>int</em><em> or </em><em>float</em>) the edge size of the square</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(point1, point2, point3, point4)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#geometry.rectangle" title="geometry.rectangle"><code class="xref py py-meth docutils literal notranslate"><span class="pre">rectangle()</span></code></a></p>
</div>
</dd></dl>
<dl class="function">
<dt id="geometry.translate">
<code class="descname">translate</code><span class="sig-paren">(</span><em>vec</em>, <em>*pts</em><span class="sig-paren">)</span><a class="headerlink" href="#geometry.translate" title="Permalink to this definition"></a></dt>
<dd><p>Translate a point or polygon by a given vector.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>vec</strong> (<em>tuple</em>) translation vector</p></li>
<li><p><strong>*pts</strong> points to translate</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(point_x, point_y) or (point1, point2, …)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">pylib</a></h1>
<h3>Navigation</h3>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, Daniel Weschke.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.0.1</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/geometry.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>