X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/blobdiff_plain/25ce908cffca380f930182a77c1e5a4491042a1c..50f0fde4dca3f10e535314b1c9d325cd9283735b:/doc/geometry.rst?ds=inline diff --git a/doc/geometry.rst b/doc/geometry.rst index 224fb3a..838ec6e 100644 --- a/doc/geometry.rst +++ b/doc/geometry.rst @@ -9,23 +9,65 @@ This class represents points in space. .. py:method:: isorigin(self) - Return true is given point is the origin. + Return ``True`` if a point is the origin. - .. py:method:: + .. py:method:: __eq__(self, other) + + Compare two Points for equality. + + .. py:method:: __add__(self, other) + + Add a Point to a Vector and return the result as a Point. + + .. py:method:: __sub__(self, other) + + Return the difference between two Points as a Vector. + .. py:method:: aspolyhedon(self) + + Return a Point as a polyhedron corresponding to the Point, assuming the Point has integer coordinates. + + .. py:class:: Vector -This class represents displacements in space. +This class represents displacements in space. + .. py:method:: __eq__(self, other) + + Compare two Vectors for equality. + + .. py:method:: __add__(self, other) + + Add either a Point or Vector to a Vector. The resulting sum is returned as the same structure *other* is. + + .. py:method:: __sub__(self, other) + + Subtract a Point or Vector from a Vector. The resulting difference is returned in the same form as *other*. + + .. py:method:: __mul__(self, other) + + Multiply a Vector by a scalar value and returns the result as a Vector. + + .. py:method:: __neg__(self) + + Negate a Vector. + + .. py:method:: norm(self) + + Normalizes a Vector. + + .. py:method:: isnull(self) + + Tests whether a Vector is null. + .. py:method:: angle(self, other) - 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 + 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 pi. .. py:method:: cross(self, other) - Calculate the cross product of two Vector3D structures. + Calculate the cross product of two Vector3D structures. If the vectors are not tridimensional, a _____ error is raised. .. py:method:: dot(self, other) @@ -33,6 +75,5 @@ This class represents displacements in space. .. py:method:: __trudiv__(self, other) - Divide the vector by the specified scalar and returns the result as a - vector. + Divide the vector by the specified scalar and returns the result as a vector.