skeinforge_tools.skeinforge_utilities.vec3 ($Date: 2008/21/04 $)
index
/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap/skeinforge_tools/skeinforge_utilities/vec3.pyc

Vec3 is a three dimensional vector class.
 
#Class vec3 is deprecated, please use Vec3 instead.
 
Below are examples of Vec3 use.
 
>>> from vec3 import Vec3
>>> origin = Vec3()
>>> origin
0.0, 0.0, 0.0
>>> pythagoras = Vec3( 3, 4, 0 )
>>> pythagoras
3.0, 4.0, 0.0
>>> pythagoras.magnitude()
5.0
>>> pythagoras.magnitudeSquared()
25
>>> triplePythagoras = pythagoras * 3.0
>>> triplePythagoras
9.0, 12.0, 0.0
>>> plane = pythagoras.dropAxis( 2 )
>>> plane
(3+4j)

 
Modules
       
__init__
math
operator

 
Classes
       
Vec3

 
class Vec3
    A three dimensional vector class.
 
  Methods defined here:
__abs__(self)
Get the magnitude of the Vec3.
__add__(self, other)
Get the sum of this Vec3 and other one.
__copy__(self)
Get the copy of this Vec3.
__div__(self, other)
Get a new Vec3 by dividing each component of this one.
__eq__(self, other)
Determine whether this vector is identical to other one.
__floordiv__(self, other)
Get a new Vec3 by floor dividing each component of this one.
__hash__(self)
Determine whether this vector is identical to other one.
__iadd__(self, other)
Add other Vec3 to this one.
__idiv__(self, other)
Divide each component of this Vec3.
__ifloordiv__(self, other)
Floor divide each component of this Vec3.
__imul__(self, other)
Multiply each component of this Vec3.
__init__(self, x=0.0, y=0.0, z=0.0)
__isub__(self, other)
Subtract other Vec3 from this one.
__itruediv__(self, other)
True divide each component of this Vec3.
__mul__(self, other)
Get a new Vec3 by multiplying each component of this one.
__ne__(self, other)
Determine whether this vector is not identical to other one.
__neg__(self)
__nonzero__(self)
__pos__ = __copy__(self)
__rdiv__(self, other)
Get a new Vec3 by dividing each component of this one.
__repr__(self)
Get the string representation of this Vec3.
__rfloordiv__(self, other)
Get a new Vec3 by floor dividing each component of this one.
__rmul__(self, other)
Get a new Vec3 by multiplying each component of this one.
__rtruediv__(self, other)
Get a new Vec3 by true dividing each component of this one.
__sub__(self, other)
Get the difference between the Vec3 and other one.
__truediv__(self, other)
Get a new Vec3 by true dividing each component of this one.
copy = __copy__(self)
cross(self, other)
Calculate the cross product of this vector with other one.
distance(self, other)
Get the Euclidean distance between this vector and other one.
distanceSquared(self, other)
Get the square of the Euclidean distance between this vector and other one.
dot(self, other)
Calculate the dot product of this vector with other one.
dropAxis(self, which)
Get a complex by removing one axis of this one.
 
Keyword arguments:
which -- the axis to drop (0=X, 1=Y, 2=Z)
getNormalized(self, other)
Get the normalized Vec3.
magnitude = __abs__(self)
magnitudeSquared(self)
Get the square of the magnitude of the Vec3.
normalize(self)
Scale each component of this Vec3 so that it has a magnitude of 1. If this Vec3 has a magnitude of 0, this method has no effect.
reflect(self, normal)
Reflect the Vec3 across the normal, which is assumed to be normalized.
setToVec3(self, other)
Set this Vec3 to be identical to other one.
setToXYZ(self, x, y, z)
Set the x, y, and z components of this Vec3.

 
Data
        __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__credits__ = 'Nophead <http://forums.reprap.org/profile.php?12,28>\nArt of Illusion <http://www.artofillusion.org/>'
__date__ = '$Date: 2008/21/04 $'
__license__ = 'GPL 3.0'
absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)

 
Author
        Enrique Perez (perez_enrique@yahoo.com)

 
Credits
        Nophead <http://forums.reprap.org/profile.php?12,28>
Art of Illusion <http://www.artofillusion.org/>