summaryrefslogtreecommitdiff
path: root/trunk/reprap/miscellaneous/python-beanshell-scripts/documentation/skeinforge_tools.skeinforge_utilities.vector3.html
blob: 35b5c436152738352add41825085b4b991db09ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module skeinforge_tools.skeinforge_utilities.vector3</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="skeinforge_tools.html"><font color="#ffffff">skeinforge_tools</font></a>.<a href="skeinforge_tools.skeinforge_utilities.html"><font color="#ffffff">skeinforge_utilities</font></a>.vector3</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/pyRepRap/skeinforge_tools/skeinforge_utilities/vector3.py">/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/skeinforge_utilities/vector3.py</a></font></td></tr></table>
    <p><tt><a href="#Vector3">Vector3</a> is a three dimensional vector class.<br>
 <br>
Below are examples of <a href="#Vector3">Vector3</a> use.<br>
 <br>
&gt;&gt;&gt; from vector3 import <a href="#Vector3">Vector3</a><br>
&gt;&gt;&gt; origin = <a href="#Vector3">Vector3</a>()<br>
&gt;&gt;&gt; origin<br>
0.0, 0.0, 0.0<br>
&gt;&gt;&gt; pythagoras = <a href="#Vector3">Vector3</a>( 3, 4, 0 )<br>
&gt;&gt;&gt; pythagoras<br>
3.0, 4.0, 0.0<br>
&gt;&gt;&gt; pythagoras.magnitude()<br>
5.0<br>
&gt;&gt;&gt; pythagoras.magnitudeSquared()<br>
25<br>
&gt;&gt;&gt; triplePythagoras = pythagoras * 3.0<br>
&gt;&gt;&gt; triplePythagoras<br>
9.0, 12.0, 0.0<br>
&gt;&gt;&gt; plane = pythagoras.dropAxis( 2 )<br>
&gt;&gt;&gt; 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>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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></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>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="skeinforge_tools.skeinforge_utilities.vector3.html#Vector3">Vector3</a>
</font></dt></dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Vector3">class <strong>Vector3</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;three&nbsp;dimensional&nbsp;vector&nbsp;class.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Vector3-__abs__"><strong>__abs__</strong></a>(self)</dt><dd><tt>Get&nbsp;the&nbsp;magnitude&nbsp;of&nbsp;the&nbsp;<a href="#Vector3">Vector3</a>.</tt></dd></dl>

<dl><dt><a name="Vector3-__add__"><strong>__add__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;the&nbsp;sum&nbsp;of&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>&nbsp;and&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__copy__"><strong>__copy__</strong></a>(self)</dt><dd><tt>Get&nbsp;the&nbsp;copy&nbsp;of&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>.</tt></dd></dl>

<dl><dt><a name="Vector3-__div__"><strong>__div__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;a&nbsp;new&nbsp;<a href="#Vector3">Vector3</a>&nbsp;by&nbsp;dividing&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__eq__"><strong>__eq__</strong></a>(self, other)</dt><dd><tt>Determine&nbsp;whether&nbsp;this&nbsp;vector&nbsp;is&nbsp;identical&nbsp;to&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__floordiv__"><strong>__floordiv__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;a&nbsp;new&nbsp;<a href="#Vector3">Vector3</a>&nbsp;by&nbsp;floor&nbsp;dividing&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__hash__"><strong>__hash__</strong></a>(self)</dt><dd><tt>Determine&nbsp;whether&nbsp;this&nbsp;vector&nbsp;is&nbsp;identical&nbsp;to&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__iadd__"><strong>__iadd__</strong></a>(self, other)</dt><dd><tt>Add&nbsp;other&nbsp;<a href="#Vector3">Vector3</a>&nbsp;to&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__idiv__"><strong>__idiv__</strong></a>(self, other)</dt><dd><tt>Divide&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>.</tt></dd></dl>

<dl><dt><a name="Vector3-__ifloordiv__"><strong>__ifloordiv__</strong></a>(self, other)</dt><dd><tt>Floor&nbsp;divide&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>.</tt></dd></dl>

<dl><dt><a name="Vector3-__imul__"><strong>__imul__</strong></a>(self, other)</dt><dd><tt>Multiply&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>.</tt></dd></dl>

<dl><dt><a name="Vector3-__init__"><strong>__init__</strong></a>(self, 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="Vector3-__isub__"><strong>__isub__</strong></a>(self, other)</dt><dd><tt>Subtract&nbsp;other&nbsp;<a href="#Vector3">Vector3</a>&nbsp;from&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__itruediv__"><strong>__itruediv__</strong></a>(self, other)</dt><dd><tt>True&nbsp;divide&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>.</tt></dd></dl>

<dl><dt><a name="Vector3-__mul__"><strong>__mul__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;a&nbsp;new&nbsp;<a href="#Vector3">Vector3</a>&nbsp;by&nbsp;multiplying&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__ne__"><strong>__ne__</strong></a>(self, other)</dt><dd><tt>Determine&nbsp;whether&nbsp;this&nbsp;vector&nbsp;is&nbsp;not&nbsp;identical&nbsp;to&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__neg__"><strong>__neg__</strong></a>(self)</dt></dl>

<dl><dt><a name="Vector3-__nonzero__"><strong>__nonzero__</strong></a>(self)</dt></dl>

<dl><dt><a name="Vector3-__pos__"><strong>__pos__</strong></a> = <a href="#Vector3-__copy__">__copy__</a>(self)</dt></dl>

<dl><dt><a name="Vector3-__rdiv__"><strong>__rdiv__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;a&nbsp;new&nbsp;<a href="#Vector3">Vector3</a>&nbsp;by&nbsp;dividing&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Get&nbsp;the&nbsp;string&nbsp;representation&nbsp;of&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>.</tt></dd></dl>

<dl><dt><a name="Vector3-__rfloordiv__"><strong>__rfloordiv__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;a&nbsp;new&nbsp;<a href="#Vector3">Vector3</a>&nbsp;by&nbsp;floor&nbsp;dividing&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__rmul__"><strong>__rmul__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;a&nbsp;new&nbsp;<a href="#Vector3">Vector3</a>&nbsp;by&nbsp;multiplying&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__rtruediv__"><strong>__rtruediv__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;a&nbsp;new&nbsp;<a href="#Vector3">Vector3</a>&nbsp;by&nbsp;true&nbsp;dividing&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__sub__"><strong>__sub__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;the&nbsp;difference&nbsp;between&nbsp;the&nbsp;<a href="#Vector3">Vector3</a>&nbsp;and&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-__truediv__"><strong>__truediv__</strong></a>(self, other)</dt><dd><tt>Get&nbsp;a&nbsp;new&nbsp;<a href="#Vector3">Vector3</a>&nbsp;by&nbsp;true&nbsp;dividing&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-copy"><strong>copy</strong></a> = <a href="#Vector3-__copy__">__copy__</a>(self)</dt></dl>

<dl><dt><a name="Vector3-cross"><strong>cross</strong></a>(self, other)</dt><dd><tt>Calculate&nbsp;the&nbsp;cross&nbsp;product&nbsp;of&nbsp;this&nbsp;vector&nbsp;with&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-distance"><strong>distance</strong></a>(self, other)</dt><dd><tt>Get&nbsp;the&nbsp;Euclidean&nbsp;distance&nbsp;between&nbsp;this&nbsp;vector&nbsp;and&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-distanceSquared"><strong>distanceSquared</strong></a>(self, other)</dt><dd><tt>Get&nbsp;the&nbsp;square&nbsp;of&nbsp;the&nbsp;Euclidean&nbsp;distance&nbsp;between&nbsp;this&nbsp;vector&nbsp;and&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-dot"><strong>dot</strong></a>(self, other)</dt><dd><tt>Calculate&nbsp;the&nbsp;dot&nbsp;product&nbsp;of&nbsp;this&nbsp;vector&nbsp;with&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-dropAxis"><strong>dropAxis</strong></a>(self, which)</dt><dd><tt>Get&nbsp;a&nbsp;complex&nbsp;by&nbsp;removing&nbsp;one&nbsp;axis&nbsp;of&nbsp;this&nbsp;one.<br>
&nbsp;<br>
Keyword&nbsp;arguments:<br>
which&nbsp;--&nbsp;the&nbsp;axis&nbsp;to&nbsp;drop&nbsp;(0=X,&nbsp;1=Y,&nbsp;2=Z)</tt></dd></dl>

<dl><dt><a name="Vector3-getNormalized"><strong>getNormalized</strong></a>(self, other)</dt><dd><tt>Get&nbsp;the&nbsp;normalized&nbsp;<a href="#Vector3">Vector3</a>.</tt></dd></dl>

<dl><dt><a name="Vector3-magnitude"><strong>magnitude</strong></a> = <a href="#Vector3-__abs__">__abs__</a>(self)</dt></dl>

<dl><dt><a name="Vector3-magnitudeSquared"><strong>magnitudeSquared</strong></a>(self)</dt><dd><tt>Get&nbsp;the&nbsp;square&nbsp;of&nbsp;the&nbsp;magnitude&nbsp;of&nbsp;the&nbsp;<a href="#Vector3">Vector3</a>.</tt></dd></dl>

<dl><dt><a name="Vector3-normalize"><strong>normalize</strong></a>(self)</dt><dd><tt>Scale&nbsp;each&nbsp;component&nbsp;of&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>&nbsp;so&nbsp;that&nbsp;it&nbsp;has&nbsp;a&nbsp;magnitude&nbsp;of&nbsp;1.&nbsp;If&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>&nbsp;has&nbsp;a&nbsp;magnitude&nbsp;of&nbsp;0,&nbsp;this&nbsp;method&nbsp;has&nbsp;no&nbsp;effect.</tt></dd></dl>

<dl><dt><a name="Vector3-reflect"><strong>reflect</strong></a>(self, normal)</dt><dd><tt>Reflect&nbsp;the&nbsp;<a href="#Vector3">Vector3</a>&nbsp;across&nbsp;the&nbsp;normal,&nbsp;which&nbsp;is&nbsp;assumed&nbsp;to&nbsp;be&nbsp;normalized.</tt></dd></dl>

<dl><dt><a name="Vector3-setToVector3"><strong>setToVector3</strong></a>(self, other)</dt><dd><tt>Set&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>&nbsp;to&nbsp;be&nbsp;identical&nbsp;to&nbsp;other&nbsp;one.</tt></dd></dl>

<dl><dt><a name="Vector3-setToXYZ"><strong>setToXYZ</strong></a>(self, x, y, z)</dt><dd><tt>Set&nbsp;the&nbsp;x,&nbsp;y,&nbsp;and&nbsp;z&nbsp;components&nbsp;of&nbsp;this&nbsp;<a href="#Vector3">Vector3</a>.</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>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>__author__</strong> = 'Enrique Perez (perez_enrique@yahoo.com)'<br>
<strong>__credits__</strong> = 'Nophead &lt;http://forums.reprap.org/profile.php?12,28&gt;<font color="#c040c0">\n</font>Art of Illusion &lt;http://www.artofillusion.org/&gt;'<br>
<strong>__date__</strong> = '$Date: 2008/21/04 $'<br>
<strong>__license__</strong> = 'GPL 3.0'<br>
<strong>absolute_import</strong> = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Enrique&nbsp;Perez&nbsp;(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>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Credits</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Nophead&nbsp;&lt;<a href="http://forums.reprap.org/profile.php?12,28">http://forums.reprap.org/profile.php?12,28</a>&gt;<br>
Art&nbsp;of&nbsp;Illusion&nbsp;&lt;<a href="http://www.artofillusion.org/">http://www.artofillusion.org/</a>&gt;</td></tr></table>
</body></html>