vec3 ($Date: 2008/21/04 $)
index
/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap_v0.1/vec3.py

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.length()
5.0
>>> pythagoras.length2()
25
>>> triplePythagoras = pythagoras.times( 3.0 )
>>> triplePythagoras
9.0, 12.0, 0.0
>>> plane = pythagoras.dropAxis( 2 )
>>> plane
(3+4j)

 
Modules
       
math

 
Classes
       
Vec3
vec3

 
class Vec3
    A three dimensional vector class.
 
  Methods defined here:
__eq__(self, another)
Determine whether this vector is identical to another one.
__hash__(self)
Determine whether this vector is identical to another one.
__init__(self, x=0.0, y=0.0, z=0.0)
__ne__(self, another)
Determine whether this vector is not identical to another one.
__repr__(self)
Get the string representation of this Vec3.
add(self, another)
Add another Vec3 to this one.
distance(self, another)
Get the Euclidean distance between this vector and another one.
 
Keyword arguments:
another -- Vec3 whose distance to the original will be calculated
distance2(self, another)
Get the square of the Euclidean distance between this vector and another one.
 
Keyword arguments:
another -- Vec3 whose squared distance to the original will be calculated
dot(self, another)
Calculate the dot product of this vector with another 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)
equals(self, another)
Determine whether this vector is identical to another one.
getFromVec3(self, another)
Get a new Vec3 identical to another one.
getFromXYZ(self, x, y, z)
Get a new Vec3 with the specified x, y, and z components.
length(self)
Get the length of the Vec3.
length2(self)
Get the square of the length of the Vec3.
minus(self, subtractVec3)
Get the difference between the Vec3 and another one.
 
Keyword arguments:
subtractVec3 -- Vec3 which will be subtracted from the original
multiply(self, another)
Multiply each component of this vector by the corresponding component of another vector.
normalize(self)
Scale each component of this Vec3 so that it has a length of 1. If this Vec3 has a length of 0, this method has no effect.
plus(self, plusVec3)
Get the sum of this Vec3 and another one.
 
Keyword arguments:
plusVec3 -- Vec3 which will be added to the original
scale(self, multiplier)
Scale each component of this Vec3 by a multiplier.
setToVec3(self, another)
Set this Vec3 to be identical to another one.
setToXYZ(self, x, y, z)
Set the x, y, and z components of this Vec3.
subtract(self, another)
Subtract another Vec3 from this one.
times(self, multiplier)
Get a new Vec3 by multiplying each component of this one by a multiplier.

 
class vec3(Vec3)
    A three dimensional vector class which completely inherits from Vec3 and is deprecated, please use Vec3 instead.
 
  Methods defined here:
__init__(self, x=0.0, y=0.0, z=0.0)

Methods inherited from Vec3:
__eq__(self, another)
Determine whether this vector is identical to another one.
__hash__(self)
Determine whether this vector is identical to another one.
__ne__(self, another)
Determine whether this vector is not identical to another one.
__repr__(self)
Get the string representation of this Vec3.
add(self, another)
Add another Vec3 to this one.
distance(self, another)
Get the Euclidean distance between this vector and another one.
 
Keyword arguments:
another -- Vec3 whose distance to the original will be calculated
distance2(self, another)
Get the square of the Euclidean distance between this vector and another one.
 
Keyword arguments:
another -- Vec3 whose squared distance to the original will be calculated
dot(self, another)
Calculate the dot product of this vector with another 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)
equals(self, another)
Determine whether this vector is identical to another one.
getFromVec3(self, another)
Get a new Vec3 identical to another one.
getFromXYZ(self, x, y, z)
Get a new Vec3 with the specified x, y, and z components.
length(self)
Get the length of the Vec3.
length2(self)
Get the square of the length of the Vec3.
minus(self, subtractVec3)
Get the difference between the Vec3 and another one.
 
Keyword arguments:
subtractVec3 -- Vec3 which will be subtracted from the original
multiply(self, another)
Multiply each component of this vector by the corresponding component of another vector.
normalize(self)
Scale each component of this Vec3 so that it has a length of 1. If this Vec3 has a length of 0, this method has no effect.
plus(self, plusVec3)
Get the sum of this Vec3 and another one.
 
Keyword arguments:
plusVec3 -- Vec3 which will be added to the original
scale(self, multiplier)
Scale each component of this Vec3 by a multiplier.
setToVec3(self, another)
Set this Vec3 to be identical to another one.
setToXYZ(self, x, y, z)
Set the x, y, and z components of this Vec3.
subtract(self, another)
Subtract another Vec3 from this one.
times(self, multiplier)
Get a new Vec3 by multiplying each component of this one by a multiplier.

 
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'

 
Author
        Enrique Perez (perez_enrique@yahoo.com)

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