Index: src/Actions/MapOfActions.cpp
===================================================================
--- src/Actions/MapOfActions.cpp	(revision 03c902cad860797759acc84bc47e60d6ebb414ca)
+++ src/Actions/MapOfActions.cpp	(revision 31fb1df09428e7671debb5867061ee049cbbd546)
@@ -256,4 +256,7 @@
   DescriptionMap["version"] = "show version";
   // keys for values
+  DescriptionMap["angle-x"] = "angle of a rotation around x axis";
+  DescriptionMap["angle-y"] = "angle of a rotation around y axis";
+  DescriptionMap["angle-z"] = "angle of a rotation around z axis";
   DescriptionMap["bin-output-file"] = "name of the bin output file";
   DescriptionMap["bin-end"] = "start of the last bin";
@@ -383,4 +386,7 @@
 
   // value types for the values
+  TypeMap["angle-x"] = &typeid(double);
+  TypeMap["angle-y"] = &typeid(double);
+  TypeMap["angle-z"] = &typeid(double);
   TypeMap["bin-output-file"] = &typeid(std::string);
   TypeMap["bin-end"] = &typeid(double);
@@ -583,4 +589,7 @@
 
     // hidden arguments
+  hidden.insert("angle-x");
+  hidden.insert("angle-y");
+  hidden.insert("angle-z");
   hidden.insert("bin-end");
   hidden.insert("bin-output-file");
Index: src/Actions/SelectionAction/AllAtomsInsideCuboidAction.cpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsInsideCuboidAction.cpp	(revision 03c902cad860797759acc84bc47e60d6ebb414ca)
+++ src/Actions/SelectionAction/AllAtomsInsideCuboidAction.cpp	(revision 31fb1df09428e7671debb5867061ee049cbbd546)
@@ -20,4 +20,5 @@
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Matrix.hpp"
 #include "LinearAlgebra/Vector.hpp"
 #include "Shapes/BaseShapes.hpp"
@@ -40,12 +41,18 @@
 class SelectionAllAtomsInsideCuboidState : public ActionState {
 public:
-  SelectionAllAtomsInsideCuboidState(std::vector<atom*> _selectedAtoms, const Vector &_position, const Vector &_extension) :
+  SelectionAllAtomsInsideCuboidState(std::vector<atom*> _selectedAtoms, const Vector &_position, const Vector &_extension, const double _Xangle, const double _Yangle, const double _Zangle) :
     selectedAtoms(_selectedAtoms),
     position(_position),
-    extension(_extension)
+    extension(_extension),
+    Xangle(_Xangle),
+    Yangle(_Yangle),
+    Zangle(_Zangle)
   {}
   std::vector<atom*> selectedAtoms;
   Vector position;
   Vector extension;
+  double Xangle;
+  double Yangle;
+  double Zangle;
 };
 
@@ -65,4 +72,13 @@
 };
 
+void SelectionAllAtomsInsideCuboid(const Vector &position, const Vector &extension, const double Xangle, const double Yangle, const double Zangle) {
+  ValueStorage::getInstance().setCurrentValue(SelectionAllAtomsInsideCuboidAction::NAME, extension);
+  ValueStorage::getInstance().setCurrentValue("position", position);
+  ValueStorage::getInstance().setCurrentValue("angle-x", Xangle);
+  ValueStorage::getInstance().setCurrentValue("angle-y", Yangle);
+  ValueStorage::getInstance().setCurrentValue("angle-z", Zangle);
+  ActionRegistry::getInstance().getActionByName(SelectionAllAtomsInsideCuboidAction::NAME)->call(Action::NonInteractive);
+};
+
 Dialog* SelectionAllAtomsInsideCuboidAction::fillDialog(Dialog *dialog) {
   ASSERT(dialog,"No Dialog given when filling action dialog");
@@ -78,12 +94,24 @@
   Vector position;
   Vector extension;
+  double Xangle = 0.;
+  double Yangle = 0.;
+  double Zangle = 0.;
+  Matrix RotationMatrix;
 
   ValueStorage::getInstance().queryCurrentValue("position", position);
   ValueStorage::getInstance().queryCurrentValue(NAME, extension);
+  // check whether a rotation is given.
+  if (ValueStorage::getInstance().queryCurrentValue("angle-x", Xangle, true))
+    Xangle = 0.;
+  if (ValueStorage::getInstance().queryCurrentValue("angle-y", Yangle, true))
+    Yangle = 0.;
+  if (ValueStorage::getInstance().queryCurrentValue("angle-z", Zangle, true))
+    Zangle = 0.;
+  RotationMatrix.rotation(Xangle, Yangle, Zangle);
 
-  DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms inside a cuboid at " << position << " and extension of " << extension << "." << endl);
-  Shape s = translate(stretch(Cuboid(),extension),position);
+  DoLog(1) && (Log() << Verbose(1) << "Selecting all atoms inside a rotated " << RotationMatrix << " cuboid at " << position << " and extension of " << extension << "." << endl);
+  Shape s = translate(transform(stretch(Cuboid(),extension),RotationMatrix),position);
   World::getInstance().selectAllAtoms(AtomByShape(s));
-  return Action::state_ptr(new SelectionAllAtomsInsideCuboidState(selectedAtoms, position, extension));
+  return Action::state_ptr(new SelectionAllAtomsInsideCuboidState(selectedAtoms, position, extension, Xangle, Yangle, Zangle));
 }
 
@@ -95,14 +123,16 @@
     World::getInstance().selectAtom(*iter);
 
-  return Action::state_ptr(new SelectionAllAtomsInsideCuboidState(state->selectedAtoms, state->position, state->extension));
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr SelectionAllAtomsInsideCuboidAction::performRedo(Action::state_ptr _state){
   SelectionAllAtomsInsideCuboidState *state = assert_cast<SelectionAllAtomsInsideCuboidState*>(_state.get());
+  Matrix RotationMatrix;
 
-  Shape s = translate(stretch(Cuboid(),state->extension),state->position);
+  RotationMatrix.rotation(state->Xangle, state->Yangle, state->Zangle);
+  Shape s = translate(transform(stretch(Cuboid(),state->extension),RotationMatrix),state->position);
   World::getInstance().selectAllAtoms(AtomByShape(s));
 
-  return Action::state_ptr(new SelectionAllAtomsInsideCuboidState(state->selectedAtoms, state->position, state->extension));
+  return Action::state_ptr(_state);
 }
 
Index: src/Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp
===================================================================
--- src/Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp	(revision 03c902cad860797759acc84bc47e60d6ebb414ca)
+++ src/Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp	(revision 31fb1df09428e7671debb5867061ee049cbbd546)
@@ -17,4 +17,5 @@
 class SelectionAllAtomsInsideCuboidAction : public Action {
   friend void SelectionAllAtomsInsideCuboid(const Vector &position, const Vector &extension);
+  friend void SelectionAllAtomsInsideCuboid(const Vector &position, const Vector &extension, const double Xangle, const double Yangle, const double Zangle);
 
 public:
Index: src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.cpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.cpp	(revision 03c902cad860797759acc84bc47e60d6ebb414ca)
+++ src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.cpp	(revision 31fb1df09428e7671debb5867061ee049cbbd546)
@@ -20,4 +20,5 @@
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Matrix.hpp"
 #include "LinearAlgebra/Vector.hpp"
 #include "Shapes/BaseShapes.hpp"
@@ -40,12 +41,18 @@
 class SelectionNotAllAtomsInsideCuboidState : public ActionState {
 public:
-  SelectionNotAllAtomsInsideCuboidState(std::vector<atom*> _selectedAtoms, const Vector &_position, const Vector &_extension) :
+  SelectionNotAllAtomsInsideCuboidState(std::vector<atom*> _selectedAtoms, const Vector &_position, const Vector &_extension, const double _Xangle, const double _Yangle, const double _Zangle) :
     selectedAtoms(_selectedAtoms),
     position(_position),
-    extension(_extension)
+    extension(_extension),
+    Xangle(_Xangle),
+    Yangle(_Yangle),
+    Zangle(_Zangle)
   {}
   std::vector<atom*> selectedAtoms;
   Vector position;
   Vector extension;
+  double Xangle;
+  double Yangle;
+  double Zangle;
 };
 
@@ -65,4 +72,13 @@
 };
 
+void SelectionNotAllAtomsInsideCuboid(const Vector &position, const Vector &extension, const double Xangle, const double Yangle, const double Zangle) {
+  ValueStorage::getInstance().setCurrentValue(SelectionNotAllAtomsInsideCuboidAction::NAME, extension);
+  ValueStorage::getInstance().setCurrentValue("position", position);
+  ValueStorage::getInstance().setCurrentValue("angle-x", Xangle);
+  ValueStorage::getInstance().setCurrentValue("angle-y", Yangle);
+  ValueStorage::getInstance().setCurrentValue("angle-z", Zangle);
+  ActionRegistry::getInstance().getActionByName(SelectionNotAllAtomsInsideCuboidAction::NAME)->call(Action::NonInteractive);
+};
+
 Dialog* SelectionNotAllAtomsInsideCuboidAction::fillDialog(Dialog *dialog) {
   ASSERT(dialog,"No Dialog given when filling action dialog");
@@ -78,12 +94,25 @@
   Vector position;
   Vector extension;
+  double Xangle = 0.;
+  double Yangle = 0.;
+  double Zangle = 0.;
+  Matrix RotationMatrix;
 
   ValueStorage::getInstance().queryCurrentValue("position", position);
   ValueStorage::getInstance().queryCurrentValue(NAME, extension);
+  // check whether a rotation is given.
+  if (ValueStorage::getInstance().queryCurrentValue("angle-x", Xangle, true))
+    Xangle = 0.;
+  if (ValueStorage::getInstance().queryCurrentValue("angle-y", Yangle, true))
+    Yangle = 0.;
+  if (ValueStorage::getInstance().queryCurrentValue("angle-z", Zangle, true))
+    Zangle = 0.;
+  RotationMatrix.rotation(Xangle, Yangle, Zangle);
 
-  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms inside a cuboid at " << position << " and extension of " << extension << "." << endl);
-  Shape s = translate(stretch(Cuboid(),extension),position);
+  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms inside a rotated " << RotationMatrix << " cuboid at " << position << " and extension of " << extension << "." << endl);
+  Shape s = translate(transform(stretch(Cuboid(),extension),RotationMatrix),position);
+
   World::getInstance().unselectAllAtoms(AtomByShape(s));
-  return Action::state_ptr(new SelectionNotAllAtomsInsideCuboidState(selectedAtoms, position, extension));
+  return Action::state_ptr(new SelectionNotAllAtomsInsideCuboidState(selectedAtoms, position, extension, Xangle, Yangle, Zangle));
 }
 
@@ -95,14 +124,16 @@
     World::getInstance().selectAtom(*iter);
 
-  return Action::state_ptr(new SelectionNotAllAtomsInsideCuboidState(state->selectedAtoms, state->position, state->extension));
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr SelectionNotAllAtomsInsideCuboidAction::performRedo(Action::state_ptr _state){
   SelectionNotAllAtomsInsideCuboidState *state = assert_cast<SelectionNotAllAtomsInsideCuboidState*>(_state.get());
+  Matrix RotationMatrix;
 
-  Shape s = translate(stretch(Cuboid(),state->extension),state->position);
+  RotationMatrix.rotation(state->Xangle, state->Yangle, state->Zangle);
+  Shape s = translate(transform(stretch(Cuboid(),state->extension),RotationMatrix),state->position);
   World::getInstance().unselectAllAtoms(AtomByShape(s));
 
-  return Action::state_ptr(new SelectionNotAllAtomsInsideCuboidState(state->selectedAtoms, state->position, state->extension));
+  return Action::state_ptr(_state);
 }
 
Index: src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp
===================================================================
--- src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp	(revision 03c902cad860797759acc84bc47e60d6ebb414ca)
+++ src/Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp	(revision 31fb1df09428e7671debb5867061ee049cbbd546)
@@ -17,4 +17,5 @@
 class SelectionNotAllAtomsInsideCuboidAction : public Action {
   friend void SelectionNotAllAtomsInsideCuboid(const Vector &position, const Vector &extension);
+  friend void SelectionNotAllAtomsInsideCuboid(const Vector &position, const Vector &extension, const double Xangle, const double Yangle, const double Zangle);
 
 public:
Index: src/LinearAlgebra/Matrix.cpp
===================================================================
--- src/LinearAlgebra/Matrix.cpp	(revision 03c902cad860797759acc84bc47e60d6ebb414ca)
+++ src/LinearAlgebra/Matrix.cpp	(revision 31fb1df09428e7671debb5867061ee049cbbd546)
@@ -115,4 +115,17 @@
 }
 
+void Matrix::rotation(const double x, const double y, const double z)
+{
+  set(0,0, cos(y)*cos(z));
+  set(0,1, cos(z)*sin(x)*sin(y) - cos(x)*sin(z));
+  set(0,2, cos(x)*cos(z)*sin(y) + sin(x) * sin(z));
+  set(1,0, cos(y)*sin(z));
+  set(1,1, cos(x)*cos(z) + sin(x)*sin(y)*sin(z));
+  set(1,2, -cos(z)*sin(x) + cos(x)*sin(y)*sin(z));
+  set(2,0, -sin(y));
+  set(2,1, cos(y)*sin(x));
+  set(2,2, cos(x)*cos(y));
+}
+
 Matrix &Matrix::operator=(const Matrix &src){
   if(&src!=this){
@@ -220,5 +233,5 @@
 
 
-void Matrix::transpose()
+Matrix &Matrix::transpose()
 {
   double tmp;
@@ -226,7 +239,8 @@
     for (int j=i+1;j<NDIM;j++) {
       tmp = at(j,i);
+      at(j,i) = at(i,j);
       at(i,j) = tmp;
-      at(j,i) = tmp;
-    }
+    }
+  return *this;
 }
 
Index: src/LinearAlgebra/Matrix.hpp
===================================================================
--- src/LinearAlgebra/Matrix.hpp	(revision 03c902cad860797759acc84bc47e60d6ebb414ca)
+++ src/LinearAlgebra/Matrix.hpp	(revision 31fb1df09428e7671debb5867061ee049cbbd546)
@@ -54,4 +54,11 @@
    */
   void zero();
+
+  /**
+   * Sets all matrix corresponding to a rotation matrix,
+   * first around the x-, then the y-, finally the z-axis
+   * with given angles.
+   */
+  void rotation(const double x, const double y, const double z);
 
   /**
@@ -113,5 +120,5 @@
    */
   Matrix transpose() const;
-  void transpose();
+  Matrix &transpose();
 
   // operators
Index: src/unittests/MatrixUnittest.cpp
===================================================================
--- src/unittests/MatrixUnittest.cpp	(revision 03c902cad860797759acc84bc47e60d6ebb414ca)
+++ src/unittests/MatrixUnittest.cpp	(revision 31fb1df09428e7671debb5867061ee049cbbd546)
@@ -14,4 +14,6 @@
 #include <cppunit/extensions/TestFactoryRegistry.h>
 #include <cppunit/ui/text/TestRunner.h>
+
+#include <cmath>
 
 #include "MatrixUnittest.hpp"
@@ -156,4 +158,18 @@
     }
   }
+}
+
+void MatrixUnittest::TransposeTest(){
+  Matrix res;
+
+  // transpose of unit is unit
+  res.one();
+  (const Matrix)res.transpose();
+  CPPUNIT_ASSERT_EQUAL(res,*one);
+
+  // transpose of transpose is same matrix
+  res.zero();
+  res.set(2,2, 1.);
+  CPPUNIT_ASSERT_EQUAL(res.transpose().transpose(),res);
 }
 
@@ -230,4 +246,25 @@
 }
 
+void MatrixUnittest::RotationTest(){
+  Matrix res;
+  Matrix inverse;
+
+  // zero rotation angles yields unity matrix
+  res.rotation(0,0,0);
+  CPPUNIT_ASSERT_EQUAL(*one, res);
+
+  // arbitrary rotation matrix has det = 1
+  res.rotation(M_PI/3.,1.,M_PI/7.);
+  CPPUNIT_ASSERT(fabs(fabs(res.determinant()) -1.) < MYEPSILON);
+
+  // inverse is rotation matrix with negative angles
+  res.rotation(M_PI/3.,0.,0.);
+  inverse.rotation(-M_PI/3.,0.,0.);
+  CPPUNIT_ASSERT_EQUAL(*one, res * inverse);
+
+  // ... or transposed
+  res.rotation(M_PI/3.,0.,0.);
+  CPPUNIT_ASSERT_EQUAL(inverse, ((const Matrix) res).transpose());
+}
 
 void MatrixUnittest::InvertTest(){
Index: src/unittests/MatrixUnittest.hpp
===================================================================
--- src/unittests/MatrixUnittest.hpp	(revision 03c902cad860797759acc84bc47e60d6ebb414ca)
+++ src/unittests/MatrixUnittest.hpp	(revision 31fb1df09428e7671debb5867061ee049cbbd546)
@@ -19,4 +19,6 @@
   CPPUNIT_TEST ( VectorTest );
   CPPUNIT_TEST ( OperationTest );
+  CPPUNIT_TEST ( TransposeTest );
+  CPPUNIT_TEST ( RotationTest );
   CPPUNIT_TEST ( InvertTest );
   CPPUNIT_TEST ( DeterminantTest );
@@ -31,4 +33,6 @@
   void VectorTest();
   void OperationTest();
+  void TransposeTest();
+  void RotationTest();
   void InvertTest();
   void DeterminantTest();
