~ubuntu-branches/ubuntu/hardy/mayavi2/hardy-backports

« back to all changes in this revision

Viewing changes to enthought.tvtk/enthought/tvtk/tools/visual.py

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2008-07-25 09:03:34 UTC
  • mfrom: (2.2.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080725090334-1hbb9fn8b3as5qy0
Tags: 2.2.0-1~hardy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
395
395
    z = property(_get_z, _set_z)    
396
396
 
397
397
    def dot(vec1, vec2):
398
 
        """ Function performs the dot vector multiplication of 2
399
 
        vector instances and returning a new vector instance equal to
400
 
        the dot product of given vectors"""
401
 
        i = vec1.x * vec2.x
402
 
        j = vec1.y * vec2.y
403
 
        k = vec1.z * vec2.z     
404
 
        dot = i + j + k 
405
 
        return dot      
 
398
        """ Function performs the dot vector multiplication of 2
 
399
        vector instances and returning a new vector instance equal to
 
400
        the dot product of given vectors"""
 
401
        i = vec1.x * vec2.x
 
402
        j = vec1.y * vec2.y
 
403
        k = vec1.z * vec2.z     
 
404
        dot = i + j + k 
 
405
        return dot      
406
406
 
407
407
    def cross(vec1, vec2):
408
 
        """ Function performing the cross vector multiplication of 2
409
 
        vector instances and returning a new vector instance equal to
410
 
        the cross product of given vectors"""
411
 
        i = (vec1.y*vec2.z - vec1.z*vec2.y)
412
 
        j = (vec1.z*vec2.x - vec1.x*vec2.z)
413
 
        k = (vec1.x*vec2.y - vec1.y*vec2.x)
414
 
        cross = MVector(i, j, k) 
415
 
        return cross
 
408
        """ Function performing the cross vector multiplication of 2
 
409
        vector instances and returning a new vector instance equal to
 
410
        the cross product of given vectors"""
 
411
        i = (vec1.y*vec2.z - vec1.z*vec2.y)
 
412
        j = (vec1.z*vec2.x - vec1.x*vec2.z)
 
413
        k = (vec1.x*vec2.y - vec1.y*vec2.x)
 
414
        cross = MVector(i, j, k) 
 
415
        return cross
416
416
 
417
417
    def mag(vec):
418
 
        """ Function computes and returns the magnitude of a vector"""
419
 
        mag = sqrt(vec[0]**2 + vec[1]**2 + vec[2]**2)
420
 
        return mag
 
418
        """ Function computes and returns the magnitude of a vector"""
 
419
        mag = sqrt(vec[0]**2 + vec[1]**2 + vec[2]**2)
 
420
        return mag
421
421
 
422
422
    def norm(vec):
423
423
        """ Function computes and returns the normalized form of a