Index: orxonox/trunk/src/lib/math/vector.h
===================================================================
--- orxonox/trunk/src/lib/math/vector.h	(revision 4372)
+++ orxonox/trunk/src/lib/math/vector.h	(revision 4476)
@@ -20,30 +20,42 @@
 class Vector {
 
-  public:
- 
-  float x; //!< The x Coordinate of the Vector.
-  float y; //!< The y Coordinate of the Vector.
-  float z; //!< The z Coordinate of the Vector.
-
+
+ public:
   Vector (float x, float y, float z) : x(x), y(y), z(z) {}  //!< assignment constructor
   Vector () : x(0), y(0), z(0) {}
   ~Vector () {}
 
-  inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); }
-  inline const Vector& operator+= (const Vector& v) {this->x += v.x; this->y += v.y; this->z += v.z; return *this;}
+  /**  \param v The vector to add \returns the addition between two vectors (this + v) */
+  inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); };
+  /** \param v The vector to add  \returns the addition between two vectors (this += v) */
+  inline const Vector& operator+= (const Vector& v) { this->x += v.x; this->y += v.y; this->z += v.z; return *this; };
+  /** \param v The vector to substract  \returns the substraction between two vectors (this - v) */
   inline Vector operator- (const Vector& v) const { return Vector(x - v.x, y - v.y, z - v.z); }
-  inline const Vector& operator-= (const Vector& v) {this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this;}
-  inline float operator* (const Vector& v) const { return x * v.x + y * v.y + z * v.z; }
-  inline const Vector& operator*= (const Vector& v) {this->x *= v.x; this->y *= v.y; this->z *= v.z; return *this;}
-  inline Vector operator* (float f) const { return Vector(x * f, y * f, z * f); }
-  inline const Vector& operator*= (float f) {this->x *= f; this->y *= f; this->z *= f; return *this;}
-  Vector operator/ (float f) const;
-  inline const Vector& operator/= (float f) {this->x /= f; this->y /= f; this->z /= f; return *this;}
-  inline const Vector& operator= (const Vector& v) {this->x = v.x; this->y = v.y; this->z = v.z; return *this;}
-  float dot (const Vector& v) const;
+  /** \param v The vector to substract  \returns the substraction between two vectors (this -= v) */
+  inline const Vector& operator-= (const Vector& v) { this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this; };
+  /** \param v the second vector  \returns The dotProduct between two vector (this (dot) v) */
+  inline float operator* (const Vector& v) const { return x * v.x + y * v.y + z * v.z; };
+  /** \todo strange */
+  inline const Vector& operator*= (const Vector& v) { this->x *= v.x; this->y *= v.y; this->z *= v.z; return *this; };
+  /** \param f a factor to multiply the vector with \returns the vector multiplied by f (this * f) */
+  inline Vector operator* (float f) const { return Vector(x * f, y * f, z * f); };
+  /** \param f a factor to multiply the vector with \returns the vector multiplied by f (this *= f) */
+  inline const Vector& operator*= (float f) { this->x *= f; this->y *= f; this->z *= f; return *this; };
+  /** \param f a factor to divide the vector with \returns the vector divided by f (this / f) */
+  inline Vector operator/ (float f) const {if (unlikely(f == 0.0)) return Vector(0,0,0); else return Vector(this->x / f, this->y / f, this->z / f); };
+  /** \param f a factor to divide the vector with \returns the vector divided by f (this /= f) */
+  inline const Vector& operator/= (float f) {if (unlikely(f == 0.0)) {this->x=0;this->y=0;this->z=0;} else {this->x /= f; this->y /= f; this->z /= f;} return *this; };
+  /** \brief copy constructor \todo (i do not know it this is faster) \param v the vector to assign to this vector. \returns the vector v */
+  inline const Vector& operator= (const Vector& v) { this->x = v.x; this->y = v.y; this->z = v.z; return *this; };
+  /** \param v: the other vector \return the dot product of the vectors */
+  float dot (const Vector& v) const { return x*v.x+y*v.y+z*v.z; };
+  /** \param v: the corss-product partner \returns the cross-product between this and v (this (x) v) */
   inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); }
-  void scale(const Vector& v);
+  /** \param scales the this vector with v */
+  void scale(const Vector& v) {   x *= v.x;  y *= v.y; z *= v.z; };
+  /** \returns the length of the vector */
   inline float len() const { return sqrt (x*x+y*y+z*z); }
-  inline void normalize() { 
+  /** \brief normalizes the vector */
+  inline void normalize() {
                       float l = len(); 
 		      if( unlikely(l == 0.0)) 
@@ -60,18 +72,36 @@
 
   void debug() const;
-};
-
-float angleDeg (const Vector& v1, const Vector& v2);
-float angleRad (const Vector& v1, const Vector& v2);
+
+ public:
+  float    x;     //!< The x Coordinate of the Vector.
+  float    y;     //!< The y Coordinate of the Vector.
+  float    z;     //!< The z Coordinate of the Vector.
+};
+
+/**
+   \brief calculate the angle between two vectors in radiances
+   \param v1: a vector
+   \param v2: another vector
+   \return the angle between the vectors in radians
+*/
+inline float angleDeg (const Vector& v1, const Vector& v2) { return acos( v1 * v2 / (v1.len() * v2.len())); };
+/**
+   \brief calculate the angle between two vectors in degrees
+   \param v1: a vector
+   \param v2: another vector
+   \return the angle between the vectors in degrees
+*/
+inline float angleRad (const Vector& v1, const Vector& v2) { return acos( v1 * v2 / (v1.len() * v2.len())) * 180/M_PI; };
+
 
 //! Quaternion
 /**
-	Class to handle 3-dimensional rotation efficiently
+   Class to handle 3-dimensional rotation efficiently
 */
 class Quaternion
 {
  public:
-  Vector v;	//!< Imaginary Vector
-  float w;        //!< Real part of the number
+  Vector    v;        //!< Imaginary Vector
+  float     w;        //!< Real part of the number
   
   inline Quaternion () { w = 1; v = Vector(0,0,0); }
