190 lines
6.6 KiB
HTML
190 lines
6.6 KiB
HTML
|
|
<!DOCTYPE html>
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>geometry module — 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>
|
|
<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</p>
|
|
<p>@date: 2019-03-21
|
|
@author: Daniel Weschke</p>
|
|
<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><p>returns
|
|
([sample_point1_x, sample_point2_x, …], [sample_points1_y, sample_point2_y, …])</p>
|
|
</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><p>returns
|
|
([sample_point1_x, sample_point2_x, …], [sample_points1_y, sample_point2_y, …])</p>
|
|
</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><p>samples: number of sampling points</p>
|
|
<p>y = (y2-y1)/(x2-x1)*(x-x1) + y1</p>
|
|
<dl class="simple">
|
|
<dt>returns</dt><dd><p>((point1_x, point2_x), (points1_y, point2_y))
|
|
or
|
|
([sample_point1_x, sample_point2_x, …], [sample_points1_y, sample_point2_y, …])</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><p>returns
|
|
((point1_x, point2_x), (point1_y, point2_y), …)</p>
|
|
</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><p>returns
|
|
(point1, point2, point3, point4)</p>
|
|
</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.</p>
|
|
<p>The angle should be given in radians.</p>
|
|
<dl class="simple">
|
|
<dt>returns</dt><dd><p>(point_x, point_y)
|
|
or
|
|
(point1, point2, …)</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.</p>
|
|
<p>The angle should be given in degrees.</p>
|
|
<dl class="simple">
|
|
<dt>returns</dt><dd><p>(point_x, point_y)
|
|
or
|
|
(point1, point2, …)</p>
|
|
</dd>
|
|
</dl>
|
|
</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><p>returns
|
|
(point1, point2, point3, point4)</p>
|
|
</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="simple">
|
|
<dt>returns</dt><dd><p>(point_x, point_y)
|
|
or
|
|
(point1, point2, …)</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">
|
|
©2019, Daniel Weschke.
|
|
|
|
|
|
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.0.1</a>
|
|
& <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> |