179 lines
13 KiB
HTML
179 lines
13 KiB
HTML
|
|
|
||
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
|
|
<html><head><title>Python: module fabmetheus_utilities.vector3index</title>
|
||
|
|
</head><body bgcolor="#f0f0f8">
|
||
|
|
|
||
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
||
|
|
<tr bgcolor="#7799ee">
|
||
|
|
<td valign=bottom> <br>
|
||
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="fabmetheus_utilities.html"><font color="#ffffff">fabmetheus_utilities</font></a>.vector3index</strong></big></big> ($Date: 2008/21/04 $)</font></td
|
||
|
|
><td align=right valign=bottom
|
||
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/fabmetheus_utilities/vector3index.py">/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/fabmetheus_utilities/vector3index.py</a></font></td></tr></table>
|
||
|
|
<p><tt>Vector3 is a three dimensional vector class.<br>
|
||
|
|
<br>
|
||
|
|
Below are examples of Vector3 use.<br>
|
||
|
|
<br>
|
||
|
|
>>> from vector3 import Vector3<br>
|
||
|
|
>>> origin = Vector3()<br>
|
||
|
|
>>> origin<br>
|
||
|
|
0.0, 0.0, 0.0<br>
|
||
|
|
>>> pythagoras = Vector3( 3, 4, 0 )<br>
|
||
|
|
>>> pythagoras<br>
|
||
|
|
3.0, 4.0, 0.0<br>
|
||
|
|
>>> pythagoras.magnitude()<br>
|
||
|
|
5.0<br>
|
||
|
|
>>> pythagoras.magnitudeSquared()<br>
|
||
|
|
25<br>
|
||
|
|
>>> triplePythagoras = pythagoras * 3.0<br>
|
||
|
|
>>> triplePythagoras<br>
|
||
|
|
9.0, 12.0, 0.0<br>
|
||
|
|
>>> plane = pythagoras.dropAxis()<br>
|
||
|
|
>>> plane<br>
|
||
|
|
(3+4j)</tt></p>
|
||
|
|
<p>
|
||
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
|
<tr bgcolor="#aa55cc">
|
||
|
|
<td colspan=3 valign=bottom> <br>
|
||
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
||
|
|
|
||
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
||
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="__init__.html">__init__</a><br>
|
||
|
|
</td><td width="25%" valign=top><a href="math.html">math</a><br>
|
||
|
|
</td><td width="25%" valign=top><a href="operator.html">operator</a><br>
|
||
|
|
</td><td width="25%" valign=top><a href="fabmetheus_utilities.xml_simple_writer.html">fabmetheus_utilities.xml_simple_writer</a><br>
|
||
|
|
</td></tr></table></td></tr></table><p>
|
||
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
|
<tr bgcolor="#ee77aa">
|
||
|
|
<td colspan=3 valign=bottom> <br>
|
||
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
||
|
|
|
||
|
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
||
|
|
<td width="100%"><dl>
|
||
|
|
<dt><font face="helvetica, arial"><a href="fabmetheus_utilities.vector3index.html#Vector3Index">Vector3Index</a>
|
||
|
|
</font></dt></dl>
|
||
|
|
<p>
|
||
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
|
<tr bgcolor="#ffc8d8">
|
||
|
|
<td colspan=3 valign=bottom> <br>
|
||
|
|
<font color="#000000" face="helvetica, arial"><a name="Vector3Index">class <strong>Vector3Index</strong></a></font></td></tr>
|
||
|
|
|
||
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||
|
|
<td colspan=2><tt>A three dimensional vector index class.<br> </tt></td></tr>
|
||
|
|
<tr><td> </td>
|
||
|
|
<td width="100%">Methods defined here:<br>
|
||
|
|
<dl><dt><a name="Vector3Index-__abs__"><strong>__abs__</strong></a>(self)</dt><dd><tt>Get the magnitude of the Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__add__"><strong>__add__</strong></a>(self, other)</dt><dd><tt>Get the sum of this Vector3 and other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__copy__"><strong>__copy__</strong></a>(self)</dt><dd><tt>Get the copy of this Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__div__"><strong>__div__</strong></a>(self, other)</dt><dd><tt>Get a new Vector3 by dividing each component of this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__eq__"><strong>__eq__</strong></a>(self, other)</dt><dd><tt>Determine whether this vector is identical to other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__floordiv__"><strong>__floordiv__</strong></a>(self, other)</dt><dd><tt>Get a new Vector3 by floor dividing each component of this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__hash__"><strong>__hash__</strong></a>(self)</dt><dd><tt>Determine whether this vector is identical to other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__iadd__"><strong>__iadd__</strong></a>(self, other)</dt><dd><tt>Add other Vector3 to this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__idiv__"><strong>__idiv__</strong></a>(self, other)</dt><dd><tt>Divide each component of this Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__ifloordiv__"><strong>__ifloordiv__</strong></a>(self, other)</dt><dd><tt>Floor divide each component of this Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__imul__"><strong>__imul__</strong></a>(self, other)</dt><dd><tt>Multiply each component of this Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__init__"><strong>__init__</strong></a>(self, index, x<font color="#909090">=0.0</font>, y<font color="#909090">=0.0</font>, z<font color="#909090">=0.0</font>)</dt></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__isub__"><strong>__isub__</strong></a>(self, other)</dt><dd><tt>Subtract other Vector3 from this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__itruediv__"><strong>__itruediv__</strong></a>(self, other)</dt><dd><tt>True divide each component of this Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__mul__"><strong>__mul__</strong></a>(self, other)</dt><dd><tt>Get a new Vector3 by multiplying each component of this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__ne__"><strong>__ne__</strong></a>(self, other)</dt><dd><tt>Determine whether this vector is not identical to other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__neg__"><strong>__neg__</strong></a>(self)</dt></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__nonzero__"><strong>__nonzero__</strong></a>(self)</dt></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__pos__"><strong>__pos__</strong></a> = <a href="#Vector3Index-__copy__">__copy__</a>(self)</dt></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__rdiv__"><strong>__rdiv__</strong></a>(self, other)</dt><dd><tt>Get a new Vector3 by dividing each component of this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get the string representation of this Vector3 index.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__rfloordiv__"><strong>__rfloordiv__</strong></a>(self, other)</dt><dd><tt>Get a new Vector3 by floor dividing each component of this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__rmul__"><strong>__rmul__</strong></a>(self, other)</dt><dd><tt>Get a new Vector3 by multiplying each component of this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__rtruediv__"><strong>__rtruediv__</strong></a>(self, other)</dt><dd><tt>Get a new Vector3 by true dividing each component of this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__sub__"><strong>__sub__</strong></a>(self, other)</dt><dd><tt>Get the difference between the Vector3 and other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-__truediv__"><strong>__truediv__</strong></a>(self, other)</dt><dd><tt>Get a new Vector3 by true dividing each component of this one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-copy"><strong>copy</strong></a> = <a href="#Vector3Index-__copy__">__copy__</a>(self)</dt></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-cross"><strong>cross</strong></a>(self, other)</dt><dd><tt>Calculate the cross product of this vector with other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-distance"><strong>distance</strong></a>(self, other)</dt><dd><tt>Get the Euclidean distance between this vector and other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-distanceSquared"><strong>distanceSquared</strong></a>(self, other)</dt><dd><tt>Get the square of the Euclidean distance between this vector and other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-dot"><strong>dot</strong></a>(self, other)</dt><dd><tt>Calculate the dot product of this vector with other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-dropAxis"><strong>dropAxis</strong></a>(self, which<font color="#909090">=2</font>)</dt><dd><tt>Get a complex by removing one axis of the vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-getFloatList"><strong>getFloatList</strong></a>(self)</dt><dd><tt>Get the vector as a list of floats.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-getIsDefault"><strong>getIsDefault</strong></a>(self)</dt><dd><tt>Determine if this is the zero vector.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-getNormalized"><strong>getNormalized</strong></a>(self)</dt><dd><tt>Get the normalized Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-magnitude"><strong>magnitude</strong></a> = <a href="#Vector3Index-__abs__">__abs__</a>(self)</dt></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-magnitudeSquared"><strong>magnitudeSquared</strong></a>(self)</dt><dd><tt>Get the square of the magnitude of the Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-maximize"><strong>maximize</strong></a>(self, other)</dt><dd><tt>Maximize the Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-minimize"><strong>minimize</strong></a>(self, other)</dt><dd><tt>Minimize the Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-normalize"><strong>normalize</strong></a>(self)</dt><dd><tt>Scale each component of this Vector3 so that it has a magnitude of 1. If this Vector3 has a magnitude of 0, this method has no effect.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-reflect"><strong>reflect</strong></a>(self, normal)</dt><dd><tt>Reflect the Vector3 across the normal, which is assumed to be normalized.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-setToVector3"><strong>setToVector3</strong></a>(self, other)</dt><dd><tt>Set this Vector3 to be identical to other one.</tt></dd></dl>
|
||
|
|
|
||
|
|
<dl><dt><a name="Vector3Index-setToXYZ"><strong>setToXYZ</strong></a>(self, x, y, z)</dt><dd><tt>Set the x, y, and z components of this Vector3.</tt></dd></dl>
|
||
|
|
|
||
|
|
</td></tr></table></td></tr></table><p>
|
||
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
|
<tr bgcolor="#55aa55">
|
||
|
|
<td colspan=3 valign=bottom> <br>
|
||
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
||
|
|
|
||
|
|
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
||
|
|
<td width="100%"><strong>__author__</strong> = 'Enrique Perez (perez_enrique@yahoo.com)'<br>
|
||
|
|
<strong>__credits__</strong> = 'Nophead <http://forums.reprap.org/profile.php?12,28><font color="#c040c0">\n</font>Art of Illusion <http://www.artofillusion.org/>'<br>
|
||
|
|
<strong>__date__</strong> = '$Date: 2008/21/04 $'<br>
|
||
|
|
<strong>__license__</strong> = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'<br>
|
||
|
|
<strong>absolute_import</strong> = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)<br>
|
||
|
|
<strong>globalGetAccessibleAttributeSet</strong> = ['x', 'y', 'z']<br>
|
||
|
|
<strong>globalSetAccessibleAttributeSet</strong> = ['x', 'y', 'z']</td></tr></table><p>
|
||
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
|
<tr bgcolor="#7799ee">
|
||
|
|
<td colspan=3 valign=bottom> <br>
|
||
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
|
||
|
|
|
||
|
|
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
||
|
|
<td width="100%">Enrique Perez (perez_enrique@yahoo.com)</td></tr></table><p>
|
||
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
|
<tr bgcolor="#7799ee">
|
||
|
|
<td colspan=3 valign=bottom> <br>
|
||
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Credits</strong></big></font></td></tr>
|
||
|
|
|
||
|
|
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
||
|
|
<td width="100%">Nophead <<a href="http://forums.reprap.org/profile.php?12,28">http://forums.reprap.org/profile.php?12,28</a>><br>
|
||
|
|
Art of Illusion <<a href="http://www.artofillusion.org/">http://www.artofillusion.org/</a>></td></tr></table>
|
||
|
|
</body></html>
|