Table of contents Index

Module bhoelHelper.gVector

Declared in module bhoelHelper

class gVector(Vector)
string __author__ = 'Berthold H\366llmann <bhoel@starship.python.net>'
string __file__ = '../bhoelHelper/gVector.pyc'
string __version__ = '1.1'

Description

This module defines two- and three-dimensional geometrical vectors. gVectors support the usual mathematical operations ( v1, v2: gVectors, s: scalar):

v1+v2
addition
v1-v2
subtraction
v1*v2
scalar product
s*v1
multiplication with a scalar
v1/s
division by a scalar
v1.cross(v2)
cross product
v1.length()
length
v1.normal()
normal vector in direction of v1
v1.angle(v2)
angle between two vectors
v1.x(), v1[0]
first element
v1.y(), v1[1]
second element
v1.z(), v1[2]
third element

The module offers the following items for export:

gVector(x,y,z)
the constructor for vectors

Note:

gVector elements can be arbitrary objects on which the standard mathematical operators plus the functions sqrt and arccos are defined.Mostly copied from Konrad Hinsen's (<hinsen@ibs.ibs.fr>) Vector.py by Berthold Höllmann.
Author: Berthold H\366llmann <>
Version: 1.1