Index: src/Legacy/oldmenu.cpp
===================================================================
--- src/Legacy/oldmenu.cpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/Legacy/oldmenu.cpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -26,4 +26,5 @@
 #include "vector_ops.hpp"
 #include "Plane.hpp"
+#include "Line.hpp"
 
 #include "UIElements/UIFactory.hpp"
@@ -184,5 +185,5 @@
           // rotate vector around first angle
           first->x = x;
-          first->x = RotateVector(first->x,z,b - M_PI);
+          first->x = Line(zeroVec,z).rotateVector(first->x,b - M_PI);
           Log() << Verbose(0) << "Rotated vector: " << first->x << endl,
           // remove the projection onto the rotation plane of the second angle
@@ -200,5 +201,5 @@
           // rotate another vector around second angle
           n = y;
-          n = RotateVector(n,x,c - M_PI);
+          n = Line(zeroVec,x).rotateVector(n,c - M_PI);
           Log() << Verbose(0) << "2nd Rotated vector: " << n << endl;
 
Index: src/Line.cpp
===================================================================
--- src/Line.cpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/Line.cpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -175,4 +175,37 @@
 }
 
+/** Rotates the vector by an angle of \a alpha around this line.
+ * \param rhs Vector to rotate
+ * \param alpha rotation angle in radian
+ */
+Vector Line::rotateVector(const Vector &rhs, double alpha) const{
+  Vector helper = rhs;
+
+  // translate the coordinate system so that the line goes through (0,0,0)
+  helper -= *origin;
+
+  // partition the vector into a part that gets rotated and a part that lies along the line
+  pair<Vector,Vector> parts = helper.partition(*direction);
+
+  // we just keep anything that is along the axis
+  Vector res = parts.first;
+
+  // the rest has to be rotated
+  Vector a = parts.second;
+  // we only have to do the rest, if we actually could partition the vector
+  if(!a.IsZero()){
+    // construct a vector that is orthogonal to a and direction and has length |a|
+    Vector y = a;
+    // direction is normalized, so the result has length |a|
+    y.VectorProduct(*direction);
+
+    res += cos(alpha) * a + sin(alpha) * y;
+  }
+
+  // translate the coordinate system back
+  res += *origin;
+  return res;
+}
+
 Line makeLineThrough(const Vector &x1, const Vector &x2){
   if(x1==x2){
Index: src/Line.hpp
===================================================================
--- src/Line.hpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/Line.hpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -33,4 +33,6 @@
   Vector getIntersection(const Line& otherLine) const;
 
+  Vector rotateVector(const Vector &rhs, double alpha) const;
+
 private:
   std::auto_ptr<Vector> origin;
Index: src/Plane.cpp
===================================================================
--- src/Plane.cpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/Plane.cpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -42,5 +42,4 @@
 /**
  * Constructs a plane from two direction vectors and a offset.
- * If no offset is given a plane through origin is assumed
  */
 Plane::Plane(const Vector &y1, const Vector &y2, double _offset) throw(ZeroVectorException,LinearDependenceException) :
Index: src/Space.cpp
===================================================================
--- src/Space.cpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/Space.cpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -19,4 +19,9 @@
 }
 
+Vector Space::getVectorToPoint(const Vector &origin) const{
+  Vector support = getClosestPoint(origin);
+  return support-origin;
+}
+
 bool Space::isContained(const Vector &point) const{
   return (distance(point)) < MYEPSILON;
Index: src/Space.hpp
===================================================================
--- src/Space.hpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/Space.hpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -19,4 +19,5 @@
   virtual double distance(const Vector &point) const=0;
   virtual Vector getClosestPoint(const Vector &point) const=0;
+  virtual Vector getVectorToPoint(const Vector &point) const;
   virtual bool isContained(const Vector &point) const;
   virtual bool hasZero() const;
Index: src/unittests/LineUnittest.cpp
===================================================================
--- src/unittests/LineUnittest.cpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/unittests/LineUnittest.cpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -221,2 +221,133 @@
   CPPUNIT_ASSERT_THROW(la3->getIntersection(*lp1),SkewException);
 }
+
+void LineUnittest::rotationTest(){
+  Vector fixture;
+
+  // rotate zero Vector along the axes lines by various degrees
+  fixture = la1->rotateVector(zeroVec,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);
+  fixture = la2->rotateVector(zeroVec,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);
+  fixture = la3->rotateVector(zeroVec,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);
+
+  fixture = la1->rotateVector(zeroVec,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);
+  fixture = la2->rotateVector(zeroVec,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);
+  fixture = la3->rotateVector(zeroVec,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);
+
+  // rotate vectors on the axis around their lines
+  fixture = la1->rotateVector(e1,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e1);
+  fixture = la2->rotateVector(e2,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e2);
+  fixture = la3->rotateVector(e3,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e3);
+
+  fixture = la1->rotateVector(e1,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e1);
+  fixture = la2->rotateVector(e2,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e2);
+  fixture = la3->rotateVector(e3,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e3);
+
+  // more vectors on the axis
+  fixture = la1->rotateVector(2*e1,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,2*e1);
+  fixture = la2->rotateVector(2*e2,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,2*e2);
+  fixture = la3->rotateVector(2*e3,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,2*e3);
+
+  fixture = la1->rotateVector(2*e1,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,2*e1);
+  fixture = la2->rotateVector(2*e2,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,2*e2);
+  fixture = la3->rotateVector(2*e3,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,2*e3);
+
+  // negative factors
+  fixture = la1->rotateVector(-1*e1,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e1);
+  fixture = la2->rotateVector(-1*e2,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e2);
+  fixture = la3->rotateVector(-1*e3,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e3);
+
+  fixture = la1->rotateVector(-1*e1,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e1);
+  fixture = la2->rotateVector(-1*e2,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e2);
+  fixture = la3->rotateVector(-1*e3,2.);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e3);
+
+
+
+  // now the real rotations
+  // e2 around e1
+  fixture = la1->rotateVector(e2,0);
+  CPPUNIT_ASSERT_EQUAL(fixture,e2);
+  fixture = la1->rotateVector(e2,1./2.*M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e3);
+  fixture = la1->rotateVector(e2,M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e2);
+  fixture = la1->rotateVector(e2,2*M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,e2);
+
+  // e3 around e2
+  fixture = la2->rotateVector(e3,0);
+  CPPUNIT_ASSERT_EQUAL(fixture,e3);
+  fixture = la2->rotateVector(e3,1./2.*M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e1);
+  fixture = la2->rotateVector(e3,M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e3);
+  fixture = la2->rotateVector(e3,2*M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,e3);
+
+  // e1 around e3
+  fixture = la3->rotateVector(e1,0);
+  CPPUNIT_ASSERT_EQUAL(fixture,e1);
+  fixture = la3->rotateVector(e1,1./2.*M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e2);
+  fixture = la3->rotateVector(e1,M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,-1*e1);
+  fixture = la3->rotateVector(e1,2*M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,e1);
+
+
+  // and some rotation around the plane lines
+
+  // Vectors on the line
+  fixture = lp1->rotateVector(e1,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e1);
+  fixture = lp1->rotateVector(e2,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e2);
+
+  fixture = lp2->rotateVector(e2,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e2);
+  fixture = lp2->rotateVector(e3,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e3);
+
+  fixture = lp3->rotateVector(e3,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e3);
+  fixture = lp3->rotateVector(e1,1.);
+  CPPUNIT_ASSERT_EQUAL(fixture,e1);
+
+  // the real stuff
+  fixture = lp1->rotateVector(zeroVec,M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,Vector(1,1,0));
+  fixture = lp2->rotateVector(zeroVec,M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,Vector(0,1,1));
+  fixture = lp3->rotateVector(zeroVec,M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,Vector(1,0,1));
+
+  fixture = lp1->rotateVector(zeroVec,2*M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);
+  fixture = lp2->rotateVector(zeroVec,2*M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);
+  fixture = lp3->rotateVector(zeroVec,2*M_PI);
+  CPPUNIT_ASSERT_EQUAL(fixture,zeroVec);
+}
Index: src/unittests/LineUnittest.hpp
===================================================================
--- src/unittests/LineUnittest.hpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/unittests/LineUnittest.hpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -21,4 +21,5 @@
   CPPUNIT_TEST ( isContainedTest );
   CPPUNIT_TEST ( intersectionTest );
+  CPPUNIT_TEST ( rotationTest );
   CPPUNIT_TEST_SUITE_END();
 
@@ -31,4 +32,5 @@
   void isContainedTest();
   void intersectionTest();
+  void rotationTest();
 
 private:
Index: src/unittests/vectorunittest.cpp
===================================================================
--- src/unittests/vectorunittest.cpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/unittests/vectorunittest.cpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -230,35 +230,4 @@
 };
 
-/** UnitTest for vector rotations.
- */
-void VectorTest::VectorRotationTest()
-{
-  fixture = Vector(-1.,0.,0.);
-
-  // zero vector does not change
-  fixture = RotateVector(zero,unit, 1.);
-  CPPUNIT_ASSERT_EQUAL( zero, fixture );
-
-  fixture = RotateVector(zero, two, 1.);
-  CPPUNIT_ASSERT_EQUAL( zero,  fixture);
-
-  // vector on axis does not change
-  fixture = RotateVector(unit,unit, 1.);
-  CPPUNIT_ASSERT_EQUAL( unit, fixture );
-
-  // rotations
-  fixture = RotateVector(otherunit, unit, M_PI);
-  CPPUNIT_ASSERT_EQUAL( Vector(0.,-1.,0.), fixture );
-
-  fixture = RotateVector(otherunit, unit, 2. * M_PI);
-  CPPUNIT_ASSERT_EQUAL( otherunit, fixture );
-
-  fixture = RotateVector(otherunit,unit, 0);
-  CPPUNIT_ASSERT_EQUAL( otherunit, fixture );
-
-  fixture = RotateVector(Vector(0.,0.,1.), notunit, M_PI);
-  CPPUNIT_ASSERT_EQUAL( otherunit, fixture );
-}
-
 /**
  * UnitTest for Vector::IsInParallelepiped().
Index: src/unittests/vectorunittest.hpp
===================================================================
--- src/unittests/vectorunittest.hpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/unittests/vectorunittest.hpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -28,5 +28,4 @@
     CPPUNIT_TEST ( NormalsTest );
     CPPUNIT_TEST ( LineIntersectionTest );
-    CPPUNIT_TEST ( VectorRotationTest );
     CPPUNIT_TEST ( IsInParallelepipedTest );
     CPPUNIT_TEST_SUITE_END();
Index: src/vector.cpp
===================================================================
--- src/vector.cpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/vector.cpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -213,7 +213,7 @@
 {
   Vector tmp;
-  tmp[0] = x[1]* (y[2]) - x[2]* (y[1]);
-  tmp[1] = x[2]* (y[0]) - x[0]* (y[2]);
-  tmp[2] = x[0]* (y[1]) - x[1]* (y[0]);
+  tmp[0] = x[1]* y[2] - x[2]* y[1];
+  tmp[1] = x[2]* y[0] - x[0]* y[2];
+  tmp[2] = x[0]* y[1] - x[1]* y[0];
   (*this) = tmp;
 };
@@ -232,30 +232,4 @@
   *this -= tmp;
 };
-
-/** Calculates the minimum distance vector of this vector to the plane.
- * \param *out output stream for debugging
- * \param *PlaneNormal normal of plane
- * \param *PlaneOffset offset of plane
- * \return distance to plane
- * \return distance vector onto to plane
- */
-Vector Vector::GetDistanceVectorToPlane(const Vector &PlaneNormal, const Vector &PlaneOffset) const
-{
-  Vector temp = (*this) - PlaneOffset;
-  temp.MakeNormalTo(PlaneNormal);
-  temp.Scale(-1.);
-  // then add connecting vector from plane to point
-  temp += (*this)-PlaneOffset;
-  double sign = temp.ScalarProduct(PlaneNormal);
-  if (fabs(sign) > MYEPSILON)
-    sign /= fabs(sign);
-  else
-    sign = 0.;
-
-  temp.Normalize();
-  temp.Scale(sign);
-  return temp;
-};
-
 
 /** Calculates the minimum distance of this vector to the plane.
Index: src/vector.hpp
===================================================================
--- src/vector.hpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/vector.hpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -44,5 +44,4 @@
 
   double DistanceSquared(const Vector &y) const;
-  Vector GetDistanceVectorToPlane(const Vector &PlaneNormal, const Vector &PlaneOffset) const;
   double DistanceToSpace(const Space& space) const;
   double PeriodicDistance(const Vector &y, const double * const cell_size) const;
Index: src/vector_ops.cpp
===================================================================
--- src/vector_ops.cpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/vector_ops.cpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -111,34 +111,2 @@
   return true;
 };
-
-/** Rotates the vector relative to the origin around the axis given by \a *axis by an angle of \a alpha.
- * \param *axis rotation axis
- * \param alpha rotation angle in radian
- */
-Vector RotateVector(const Vector &vec,const Vector &axis, const double alpha)
-{
-  Vector a,y;
-  Vector res;
-  // normalise this vector with respect to axis
-  a = vec;
-  a.ProjectOntoPlane(axis);
-  // construct normal vector
-  try {
-    y = Plane(axis,a,0).getNormal();
-  }
-  catch (MathException &excp) {
-    // The normal vector cannot be created if there is linar dependency.
-    // Then the vector to rotate is on the axis and any rotation leads to the vector itself.
-    return vec;
-  }
-  y.Scale(vec.Norm());
-  // scale normal vector by sine and this vector by cosine
-  y.Scale(sin(alpha));
-  a.Scale(cos(alpha));
-  res = vec.Projection(axis);
-  // add scaled normal vector onto this vector
-  res += y;
-  // add part in axis direction
-  res += a;
-  return res;
-};
Index: src/vector_ops.hpp
===================================================================
--- src/vector_ops.hpp	(revision 643e7632e285a017dfb1b785b9f930ba145de897)
+++ src/vector_ops.hpp	(revision 42a101a868efe57386bf87ed2524b862729e936a)
@@ -10,5 +10,4 @@
 
 bool LSQdistance(Vector &res,const Vector **vectors, int num);
-Vector RotateVector(const Vector &vec,const Vector &axis, const double alpha);
 
 #endif /* VECTOR_OPS_HPP_ */
