Index: src/Tesselation/unittests/Tesselation_BoundaryTriangleUnitTest.cpp
===================================================================
--- src/Tesselation/unittests/Tesselation_BoundaryTriangleUnitTest.cpp	(revision 368207d37f01a6b6632259661bf2b1af61b2c0e5)
+++ src/Tesselation/unittests/Tesselation_BoundaryTriangleUnitTest.cpp	(revision 471dece7cc1b45cf20a25bfe33c2a44ddf8b481f)
@@ -30,4 +30,6 @@
 #include "Helpers/defs.hpp"
 #include "Atom/TesselPoint.hpp"
+#include "LinearAlgebra/Plane.hpp"
+#include "LinearAlgebra/VectorSet.hpp"
 #include "Tesselation/BoundaryPointSet.hpp"
 #include "Tesselation/BoundaryLineSet.hpp"
@@ -49,24 +51,16 @@
 
 
-void TesselationBoundaryTriangleTest::setUp()
-{
-  setVerbosity(5);
+void TesselationBoundaryTriangleTest::createTriangle(const std::vector<Vector> &Vectors)
+{
+  CPPUNIT_ASSERT_EQUAL( (size_t)3, Vectors.size() );
 
   // create nodes
-  tesselpoints[0] = new TesselPoint;
-  tesselpoints[0]->setPosition(Vector(0., 0., 0.));
-  tesselpoints[0]->setName("1");
-  tesselpoints[0]->setNr(1);
-  points[0] = new BoundaryPointSet(tesselpoints[0]);
-  tesselpoints[1] = new TesselPoint;
-  tesselpoints[1]->setPosition(Vector(0., 1., 0.));
-  tesselpoints[1]->setName("2");
-  tesselpoints[1]->setNr(2);
-  points[1] = new BoundaryPointSet(tesselpoints[1]);
-  tesselpoints[2] = new TesselPoint;
-  tesselpoints[2]->setPosition(Vector(1., 0., 0.));
-  tesselpoints[2]->setName("3");
-  tesselpoints[2]->setNr(3);
-  points[2] = new BoundaryPointSet(tesselpoints[2] );
+  for (size_t count = 0; count < NDIM; ++count) {
+    tesselpoints[count] = new TesselPoint;
+    tesselpoints[count]->setPosition( Vectors[count] );
+    tesselpoints[count]->setName(toString(count));
+    tesselpoints[count]->setNr(count);
+    points[count] = new BoundaryPointSet(tesselpoints[count]);
+  }
 
   // create line
@@ -77,7 +71,21 @@
   // create triangle
   triangle = new BoundaryTriangleSet(lines, 0);
-  triangle->GetNormalVector(Vector(0.,0.,1.));
-};
-
+  Plane p(Vectors[0], Vectors[1], Vectors[2]);
+  triangle->GetNormalVector(p.getNormal());
+}
+
+void TesselationBoundaryTriangleTest::setUp()
+{
+  setVerbosity(5);
+
+  // create nodes
+  std::vector<Vector> Vectors;
+  Vectors.push_back( Vector(0., 0., 0.) );
+  Vectors.push_back( Vector(0., 1., 0.) );
+  Vectors.push_back( Vector(1., 0., 0.) );
+
+  // create triangle
+  createTriangle(Vectors);
+}
 
 void TesselationBoundaryTriangleTest::tearDown()
@@ -92,4 +100,104 @@
 };
 
+/** UnitTest for Tesselation::IsInsideTriangle()
+ */
+void TesselationBoundaryTriangleTest::IsInsideTriangleTest()
+{
+  // inside points
+  {
+    // check each endnode
+    for (size_t i=0; i< NDIM; ++i) {
+      const Vector testPoint(triangle->endpoints[i]->node->getPosition());
+      LOG(1, "INFO: Testing whether " << testPoint << " is an inner point.");
+      CPPUNIT_ASSERT( triangle->IsInsideTriangle( testPoint ) );
+    }
+  }
+
+  {
+    // check points along each BoundaryLine
+    for (size_t i=0; i< NDIM; ++i) {
+      Vector offset = triangle->endpoints[i%3]->node->getPosition();
+      Vector direction = triangle->endpoints[(i+1)%3]->node->getPosition() - offset;
+      for (double s = 0.1; s < 1.; s+= 0.1) {
+        Vector testPoint = offset + s*direction;
+        LOG(1, "INFO: Testing whether " << testPoint << " is an inner point.");
+        CPPUNIT_ASSERT( triangle->IsInsideTriangle( testPoint ) );
+      }
+    }
+  }
+
+  {
+    // check central point
+    Vector center;
+    triangle->GetCenter(center);
+    LOG(1, "INFO: Testing whether " << center << " is an inner point.");
+    CPPUNIT_ASSERT( triangle->IsInsideTriangle( center ) );
+  }
+
+  // outside points
+  {
+    // check points outside (i.e. those not in xy-plane through origin)
+    double n[3];
+    const double boundary = 4.;
+    const double step = 1.;
+    // go through the cube and check each point
+    for (n[0] = -boundary; n[0] <= boundary; n[0]+=step)
+      for (n[1] = -boundary; n[1] <= boundary; n[1]+=step)
+        for (n[2] = -boundary; n[2] <= boundary; n[2]+=step) {
+          const Vector testPoint(n[0], n[1], n[2]);
+          if (n[2] != 0) {
+            LOG(1, "INFO: Testing whether " << testPoint << " is not an inner point.");
+            CPPUNIT_ASSERT( !triangle->IsInsideTriangle( testPoint ) );
+          }
+        }
+  }
+
+  {
+    // check points within the plane but outside of triangle
+    double n[3];
+    const double boundary = 4.;
+    const double step = 1.;
+    n[2] = 0;
+    for (n[0] = -boundary; n[0] <= boundary; n[0]+=step)
+      for (n[1] = -boundary; n[1] <= boundary; n[1]+=step) {
+        const Vector testPoint(n[0], n[1], n[2]);
+        if ((n[0] >=0) && (n[1] >=0) && (n[0]<=1) && (n[1]<=1)) {
+          if (n[0]+n[1] <= 1) {
+            LOG(1, "INFO: Testing whether " << testPoint << " is an inner point.");
+            CPPUNIT_ASSERT( triangle->IsInsideTriangle( testPoint) );
+          } else {
+            LOG(1, "INFO: Testing whether " << testPoint << " is not an inner point.");
+            CPPUNIT_ASSERT( !triangle->IsInsideTriangle( testPoint) );
+          }
+        } else {
+          LOG(1, "INFO: Testing whether " << testPoint << " is not an inner point.");
+          CPPUNIT_ASSERT( !triangle->IsInsideTriangle( testPoint) );
+        }
+      }
+  }
+}
+
+/** UnitTest for Tesselation::IsInsideTriangle()
+ *
+ * We test for some specific points that occured in larger examples of the code.
+ *
+ */
+void TesselationBoundaryTriangleTest::IsInsideTriangle_specificTest()
+{
+  delete triangle;
+  {
+    // test is from --create-micelle 200 --radius 30. --position "0,0,0" of sles.data
+    // failure is: Intersection (23.1644,24.1867,65.1272) is not inside triangle [659|Na2451,O3652,Na3762].
+    const Vector testPoint(1.57318,1.57612,10.9874);
+    const Vector testIntersection(23.1644,24.1867,65.1272);
+    std::vector<Vector> vectors;
+    vectors.push_back( Vector(23.0563,30.4673,73.7555) );
+    vectors.push_back( Vector(25.473,25.1512,68.5467) );
+    vectors.push_back( Vector(23.1644,24.1867,65.1272) );
+    createTriangle(vectors);
+    CPPUNIT_ASSERT( triangle->IsInsideTriangle( testIntersection ) );
+  }
+}
+
 /** UnitTest for Tesselation::IsInnerPoint()
  */
Index: src/Tesselation/unittests/Tesselation_BoundaryTriangleUnitTest.hpp
===================================================================
--- src/Tesselation/unittests/Tesselation_BoundaryTriangleUnitTest.hpp	(revision 368207d37f01a6b6632259661bf2b1af61b2c0e5)
+++ src/Tesselation/unittests/Tesselation_BoundaryTriangleUnitTest.hpp	(revision 471dece7cc1b45cf20a25bfe33c2a44ddf8b481f)
@@ -19,4 +19,7 @@
 #include <cppunit/extensions/HelperMacros.h>
 
+#include <vector>
+
+#include "LinearAlgebra/Vector.hpp"
 #include "LinkedCell/linkedcell.hpp"
 #include "Tesselation/tesselation.hpp"
@@ -29,4 +32,6 @@
 {
     CPPUNIT_TEST_SUITE( TesselationBoundaryTriangleTest) ;
+    CPPUNIT_TEST ( IsInsideTriangleTest );
+    CPPUNIT_TEST ( IsInsideTriangle_specificTest );
     CPPUNIT_TEST ( GetClosestPointOnPlaneTest );
     CPPUNIT_TEST ( GetClosestPointOffPlaneTest );
@@ -36,8 +41,12 @@
       void setUp();
       void tearDown();
+      void IsInsideTriangleTest();
+      void IsInsideTriangle_specificTest();
       void GetClosestPointOnPlaneTest();
       void GetClosestPointOffPlaneTest();
 
 private:
+      void createTriangle(const std::vector<Vector> &Vectors);
+
       static const double SPHERERADIUS;
 
