File: Scientific_13.html

package info (click to toggle)
python-scientific 2.2-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,368 kB
  • ctags: 2,396
  • sloc: python: 6,468; ansic: 3,643; xml: 3,596; makefile: 79; sh: 27
file content (199 lines) | stat: -rw-r--r-- 6,905 bytes parent folder | download | duplicates (3)
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<a name="Module:Scientific.Geometry.Objects3D"><h1>Module Scientific.Geometry.Objects3D</h1></a>

<hr width=70%>
<a name="Class:Scientific.Geometry.Objects3D.GeometricalObject3D"><h2>Class GeometricalObject3D: Geometrical object in 3D space</h2></a>

<p>This is an abstract base class; to create instances, use one of
the subclasses.
</p>

<b>Methods:</b><br>
<ul>
<li> <b><i>intersectWith</i></b>(<i>other</i>)
<p>Returns the geometrical object that results from the
intersection with <i>other</i>. If there is no intersection,
the result is <tt>None</tt>.</p>

<p>Note that intersection is not implemented for all possible
pairs of objects. A <tt>ValueError</tt> is raised for combinations
that haven't been implemented yet.</p>

<li> <b><i>hasPoint</i></b>(<i>point</i>)
<p>Returns 1 if <i>point</i> is in the object.</p>

<li> <b><i>distanceFrom</i></b>(<i>point</i>)
<p>Returns the distance of <i>point</i> from the closest point of the object.</p>

<li> <b><i>volume</i></b>()
<p>Returns the volume. The result is <tt>None</tt> for unbounded objects
and zero for lower-dimensional objects.</p>

</ul>
<hr width=70%>
<a name="Class:Scientific.Geometry.Objects3D.Sphere"><h2>Class Sphere: Sphere</h2></a>

<p>A subclass of GeometricalObject3D.</p>

<p>Constructor: Sphere(<i>center</i>, <i>radius</i>), where <i>center</i> is a vector and
<i>radius</i> a float.
</p>

<hr width=70%>
<a name="Class:Scientific.Geometry.Objects3D.Plane"><h2>Class Plane: Plane</h2></a>

<p>A subclass of GeometricalObject3D.</p>

<p>Constructor:</p>

<ul>
<li> <p>
Plane(<i>point</i>, <i>normal</i>), where <i>point</i> (a vector) is an arbitrary
  point in the plane and <i>normal</i> (a vector) indicated the direction
  normal to the plane.</p><li> <p>
Plane(<i>p1</i>, <i>p2</i>, <i>p3</i>), where each argument is a vector and describes
  a point in the plane. The three points may not be colinear.
</p></ul>
<b>Methods:</b><br>
<ul>
<li> <b><i>projectionOf</i></b>(<i>point</i>)
<p>Returns the projection of <i>point</i> onto the plane.</p>

<li> <b><i>rotate</i></b>(<i>axis</i>, <i>angle</i>)
<p>Returns a copy of the plane rotated around the coordinate origin.</p>

</ul>
<hr width=70%>
<a name="Class:Scientific.Geometry.Objects3D.Cone"><h2>Class Cone: Cone</h2></a>

<p>A subclass of GeometricalObject3D.</p>

<p>Constructor: Cone(<i>tip</i>, <i>axis</i>, <i>angle</i>), where <i>tip</i> is a vector
indicating the location of the tip, <i>axis</i> is a vector that
describes the direction of the line of symmetry, and <i>angle</i> is
the angle between the line of symmetry and the cone surface.
</p>

<hr width=70%>
<a name="Class:Scientific.Geometry.Objects3D.Circle"><h2>Class Circle: Circle</h2></a>

<p>A subclass of GeometricalObject3D.</p>

<p>Constructor: Circle(<i>center</i>, <i>normal</i>, <i>radius</i>), where <i>center</i>
is a vector indicating the center of the circle, <i>normal</i> is a
vector describing the direction normal to the plane of the circle,
and <i>radius</i> is a float.
</p>

<hr width=70%>
<a name="Class:Scientific.Geometry.Objects3D.Line"><h2>Class Line: Line</h2></a>

<p>A subclass of GeometricalObject3D.</p>

<p>Constructor: Line(<i>point</i>, <i>direction</i>), where <i>point</i> is a vector
indicating any point on the line and <i>direction</i> is a vector
describing the direction of the line.
</p>

<b>Methods:</b><br>
<ul>
<li> <b><i>projectionOf</i></b>(<i>point</i>)
<p>Returns the projection of <i>point</i> onto the line.</p>

</ul>
<hr width=70%>
<a name="Class:Scientific.Geometry.Objects3D.RhombicLattice"><h2>Class RhombicLattice: Lattice with rhombic elementary cell</h2></a>

<p>A lattice object contains values defined on a finite periodic
structure that is created by replicating a given elementary
cell along the three lattice vectors. The elementary cell can
contain any number of points.</p>

<p>Constructor: RhombicLattice(<i>elementary_cell</i>, <i>lattice_vectors</i>, <i>cells</i>,
                            <i>function</i>=<tt>None</tt>, <i>base</i>=<tt>None</tt>)</p>

<p><dl>
<dt><i>elementary_cell</i></dt>
<dd><p>
a list of the points (vectors) in the elementary cell</p></dd>
<dt><i>lattice_vectors</i></dt>
<dd><p>
a tuple of three vectors describing the edges
                     of the elementary cell</p></dd>
<dt><i>cells</i></dt>
<dd><p>
a tuple of three integers, indicating how often the elementary
           cell should be replicated along each lattice vector</p></dd>
<dt><i>function</i></dt>
<dd><p>
the function to be applied to each point in the lattice
              in order to obtain the value stored in the lattice.
              If no function is specified, the point itself becomes
              the value stored in the lattice.</p></dd>
<dt><i>base</i></dt>
<dd><p>
an offset added to all lattice points
</p></dd>
</dl>
</p>

<hr width=70%>
<a name="Class:Scientific.Geometry.Objects3D.BravaisLattice"><h2>Class BravaisLattice: General Bravais lattice</h2></a>

<p>This is a subclass of RhombicLattice, describing the special case
of an elementary cell containing one point.</p>

<p>Constructor: BravaisLattice(<i>lattice_vectors</i>, <i>cells</i>,
                            <i>function</i>=<tt>None</tt>, <i>base</i>=<tt>None</tt>)</p>

<p><dl>
<dt><i>lattice_vectors</i></dt>
<dd><p>
a tuple of three vectors describing the edges
                     of the elementary cell</p></dd>
<dt><i>cells</i></dt>
<dd><p>
a tuple of three integers, indicating how often the elementary
           cell should be replicated along each lattice vector</p></dd>
<dt><i>function</i></dt>
<dd><p>
the function to be applied to each point in the lattice
              in order to obtain the value stored in the lattice.
              If no function is specified, the point itself becomes
              the value stored in the lattice.</p></dd>
<dt><i>base</i></dt>
<dd><p>
an offset added to all lattice points
</p></dd>
</dl>
</p>

<hr width=70%>
<a name="Class:Scientific.Geometry.Objects3D.SCLattice"><h2>Class SCLattice: Simple cubic lattice</h2></a>

<p>This is a subclass of BravaisLattice, describing the special case
of a cubic elementary cell.</p>

<p>Constructor: SCLattice(<i>cellsize</i>, <i>cells</i>, <i>function</i>=<tt>None</tt>,
                       <i>base</i>=<tt>None</tt>)</p>

<p><dl>
<dt><i>cellsize</i></dt>
<dd><p>
the edge length of the cubic elementary cell</p></dd>
<dt><i>cells</i></dt>
<dd><p>
a tuple of three integers, indicating how often the elementary
           cell should be replicated along each lattice vector</p></dd>
<dt><i>function</i></dt>
<dd><p>
the function to be applied to each point in the lattice
              in order to obtain the value stored in the lattice.
              If no function is specified, the point itself becomes
              the value stored in the lattice.</p></dd>
<dt><i>base</i></dt>
<dd><p>
an offset added to all lattice points
</p></dd>
</dl>
</p>