Page MenuHomec4science

GeometryModule.html
No OneTemporary

File Metadata

Created
Mon, Jul 22, 13:18

GeometryModule.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>the geometry module &mdash; pNbody v4 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</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>
<link rel="top" title="pNbody v4 documentation" href="../index.html" />
<link rel="up" title="Reference" href="Reference.html" />
<link rel="next" title="the libmiyamoto module" href="LibmiyamotoModule.html" />
<link rel="prev" title="the profiles module" href="ProfilesModule.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../np-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="LibmiyamotoModule.html" title="the libmiyamoto module"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="ProfilesModule.html" title="the profiles module"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pNbody v4 documentation</a> &raquo;</li>
<li><a href="Reference.html" accesskey="U">Reference</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-pNbody.geometry">
<span id="the-geometry-module"></span><h1>the geometry module<a class="headerlink" href="#module-pNbody.geometry" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="pNbody.geometry.align">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">align</tt><big>(</big><em>x, axis1=[1, 0, 0], axis2=[0, 0, 1], point=[0, 0, 0]</em><big>)</big><a class="headerlink" href="#pNbody.geometry.align" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the object around point in order to align the axis &#8216;axis1&#8217; with the axis &#8216;axis2&#8217;.</p>
<p>axis1 : [x,y,z]
axis2 : [x,y,z]</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.boxcut">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">boxcut</tt><big>(</big><em>pos</em>, <em>args</em><big>)</big><a class="headerlink" href="#pNbody.geometry.boxcut" title="Permalink to this definition">¶</a></dt>
<dd><p>Return only particles that are inside box 1:1:1</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.boxcut_segments">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">boxcut_segments</tt><big>(</big><em>pos</em>, <em>args</em><big>)</big><a class="headerlink" href="#pNbody.geometry.boxcut_segments" title="Permalink to this definition">¶</a></dt>
<dd><p>Return only particles that are inside box 1:1:1</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.expose">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">expose</tt><big>(</big><em>obj</em>, <em>obs</em>, <em>eye=None</em>, <em>dist_eye=None</em>, <em>foc=None</em><big>)</big><a class="headerlink" href="#pNbody.geometry.expose" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate and translate the object in order to be seen as if the
observer was in x0, looking at a point in xp.</p>
<p>obj : object array to expose
obs : representation of the observer
eye : &#8216;right&#8217; or &#8216;left&#8217;
dist_eye : distance between eyes (separation = angle))
foc : focal</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.frustum">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">frustum</tt><big>(</big><em>pos</em>, <em>clip</em>, <em>size</em><big>)</big><a class="headerlink" href="#pNbody.geometry.frustum" title="Permalink to this definition">¶</a></dt>
<dd><p>Project using a frustrum matrix</p>
<p>clip = near and far planes
size = size of the box</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.get_obs">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">get_obs</tt><big>(</big><em>x0=[0.0, -50.0, 0.0], xp=[0.0, 0.0, 0.0], alpha=0, view='xz', r_obs=50</em><big>)</big><a class="headerlink" href="#pNbody.geometry.get_obs" title="Permalink to this definition">¶</a></dt>
<dd><p>From some parameters, return an obs matrix</p>
<blockquote>
x0,xp,alpha</blockquote>
<dl class="docutils">
<dt>or</dt>
<dd>xz</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.inv_viewport">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">inv_viewport</tt><big>(</big><em>xw</em>, <em>yw</em>, <em>zw</em>, <em>shape</em><big>)</big><a class="headerlink" href="#pNbody.geometry.inv_viewport" title="Permalink to this definition">¶</a></dt>
<dd><p>viewport transformation</p>
<p>xn = position (output from frustum or ortho)
shape = shape of the image</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.norm">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">norm</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#pNbody.geometry.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>return the norm of vector x</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.ortho">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">ortho</tt><big>(</big><em>pos</em>, <em>clip</em>, <em>size</em><big>)</big><a class="headerlink" href="#pNbody.geometry.ortho" title="Permalink to this definition">¶</a></dt>
<dd><p>Project using an ortho matrix</p>
<p>clip = near and far planes
size = size of the box</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.perspective">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">perspective</tt><big>(</big><em>r_obs=100.0</em>, <em>foc=50.0</em>, <em>view='xz'</em><big>)</big><a class="headerlink" href="#pNbody.geometry.perspective" title="Permalink to this definition">¶</a></dt>
<dd><p>Project the N-body model in order to get a perspective view.</p>
<p>r_obs = distance of the observer to the looking point
foc = focal
view = &#8216;xz&#8217; , &#8216;xy&#8217; , &#8216;yz&#8217;</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.rotate">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">rotate</tt><big>(</big><em>x, angle=0, axis=[1, 0, 0], point=[0, 0, 0]</em><big>)</big><a class="headerlink" href="#pNbody.geometry.rotate" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotate the positions and/or the velocities of the object around a specific axis
with respect to a specific point</p>
<p>angle : rotation angle in radian
axis : [x,y,z] : around this axis
point : [x,y,z] : rotation origin</p>
<p>use the euler rotation matrix</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.geometry.viewport">
<tt class="descclassname">pNbody.geometry.</tt><tt class="descname">viewport</tt><big>(</big><em>xn</em>, <em>shape=None</em><big>)</big><a class="headerlink" href="#pNbody.geometry.viewport" title="Permalink to this definition">¶</a></dt>
<dd><p>viewport transformation</p>
<p>xn = position (output from frustum or ortho)
shape = shape of the image</p>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/icon-small.jpg" alt="Logo"/>
</a></p>
<h4>Previous topic</h4>
<p class="topless"><a href="ProfilesModule.html"
title="previous chapter">the profiles module</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="LibmiyamotoModule.html"
title="next chapter">the libmiyamoto module</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/rst/GeometryModule.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../np-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="LibmiyamotoModule.html" title="the libmiyamoto module"
>next</a> |</li>
<li class="right" >
<a href="ProfilesModule.html" title="the profiles module"
>previous</a> |</li>
<li><a href="../index.html">pNbody v4 documentation</a> &raquo;</li>
<li><a href="Reference.html" >Reference</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011, Yves Revaz.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.4.
</div>
</body>
</html>

Event Timeline