Remove license and add to doc examples
[linpy.git] / doc / geometry.rst
1 Geometry Module
2 ===============
3
4 The geometry module is used to obtain information about the points and vertices of a ployhedra.
5
6 .. py:class:: Points
7
8 This class represents points in space.
9
10 .. py:method:: isorigin(self)
11
12 Return ``True`` if a point is the origin.
13
14 .. py:method:: __eq__(self, other)
15
16 Compare two Points for equality.
17
18 .. py:method:: __add__(self, other)
19
20 Add a Point to a Vector and return the result as a Point.
21
22 .. py:method:: __sub__(self, other)
23
24 Return the difference between two Points as a Vector.
25
26 .. py:method:: aspolyhedon(self)
27
28 Return a Point as a polyhedron corresponding to the Point, assuming the Point has integer coordinates.
29
30
31 .. py:class:: Vector
32
33 This class represents displacements in space.
34
35 .. py:method:: __eq__(self, other)
36
37 Compare two Vectors for equality.
38
39 .. py:method:: __add__(self, other)
40
41 Add either a Point or Vector to a Vector. The resulting sum is returned as the same structure *other* is.
42
43 .. py:method:: __sub__(self, other)
44
45 Subtract a Point or Vector from a Vector. The resulting difference is returned in the same form as *other*.
46
47 .. py:method:: __mul__(self, other)
48
49 Multiply a Vector by a scalar value and returns the result as a Vector.
50
51 .. py:method:: __neg__(self)
52
53 Negate a Vector.
54
55 .. py:method:: norm(self)
56
57 Normalizes a Vector.
58
59 .. py:method:: isnull(self)
60
61 Tests whether a Vector is null.
62
63 .. py:method:: angle(self, other)
64
65 Retrieve the angle required to rotate the vector into the vector passed in argument. The result is an angle in radians, ranging between -pi and
66 pi.
67
68 .. py:method:: cross(self, other)
69
70 Calculate the cross product of two Vector3D structures. If the vectors are not tridimensional, a _____ error is raised.
71
72 .. py:method:: dot(self, other)
73
74 Calculate the dot product of two vectors.
75
76 .. py:method:: __trudiv__(self, other)
77
78 Divide the vector by the specified scalar and returns the result as a vector.
79