Index: src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp
===================================================================
--- src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp	(revision 2cd0a06a9eef32eeab4f2af6fe6ee97d12aac94f)
+++ src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp	(revision 2268600b99b47ddc105767e57e705a445948ef84)
@@ -74,5 +74,5 @@
   ASSERT_DO(Assert::Throw);
 
-  setVerbosity(5);
+  setVerbosity(6);
 }
 
@@ -190,4 +190,75 @@
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
   }
+
+  // test with two points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.), Vector(-0.5, sqrt(3)*0.5,0.);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<3>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with two points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-0.5, sqrt(3)*0.5,0.), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<3>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with three points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.), Vector(-0.5, sqrt(3)*0.5,0.), Vector(-0.5, -sqrt(3)*0.5,0.);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<3>();
+    SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+
+  // test with three points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-0.5, sqrt(3)*0.5,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-0.5, -sqrt(3)*0.5,0.), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<3>();
+    SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
 }
 
@@ -232,4 +303,86 @@
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
   }
+
+  // test with two points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.), Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<4>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with two points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<4>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with three points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        Vector(1.,0.,0.),
+        Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.),
+        Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3));
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<4>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with three points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3)), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<4>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
 }
 
@@ -274,4 +427,96 @@
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
   }
+
+  // test with two points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.), Vector(-1.,0.,0.);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<5>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with two points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180.*M_PI),
+        RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180.*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<5>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180.*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    // the three remaining points sit on a plane that may be rotated arbitrarily
+    // so we cannot simply check for equality between expected and remaining
+    // hence, we just check that they are orthogonal to the first two points
+    CPPUNIT_ASSERT_EQUAL( expected.size(), remaining.size() );
+    for (SphericalPointDistribution::Polygon_t::const_iterator fixiter = polygon.begin();
+        fixiter != polygon.end(); ++fixiter) {
+      for (SphericalPointDistribution::Polygon_t::const_iterator iter = remaining.begin();
+          iter != remaining.end(); ++iter) {
+        CPPUNIT_ASSERT( (*fixiter).IsNormalTo(*iter) );
+      }
+    }
+  }
+
+  // test with three points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        Vector(1.,0.,0.),
+        Vector(-1., 0.0, 0.0),
+        Vector(0.0, 1., 0.0);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<5>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with three points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<5>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
 }
 
@@ -316,4 +561,96 @@
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
   }
+
+  // test with two points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.), Vector(-1.,0.,0.);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<6>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second spoint
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with two points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<6>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second spoint
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    // the four remaining points sit on a plane that may have been rotated arbitrarily
+    // so we cannot simply check for equality between expected and remaining
+    // hence, we just check that they are orthogonal to the first two points
+    CPPUNIT_ASSERT_EQUAL( expected.size(), remaining.size() );
+    for (SphericalPointDistribution::Polygon_t::const_iterator fixiter = polygon.begin();
+        fixiter != polygon.end(); ++fixiter) {
+      for (SphericalPointDistribution::Polygon_t::const_iterator iter = remaining.begin();
+          iter != remaining.end(); ++iter) {
+        CPPUNIT_ASSERT( (*fixiter).IsNormalTo(*iter) );
+      }
+    }
+  }
+
+  // test with three points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        Vector(1.,0.,0.),
+        Vector(-1., 0.0, 0.0),
+        Vector(0.0, 1., 0.0);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<6>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with three points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<6>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
 }
 
@@ -358,4 +695,96 @@
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
   }
+
+  // test with two points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.), Vector(-1.,0.,0.);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<7>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with two points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<7>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    // the five remaining points sit on a plane that may have been rotated arbitrarily
+    // so we cannot simply check for equality between expected and remaining
+    // hence, we just check that they are orthogonal to the first two points
+    CPPUNIT_ASSERT_EQUAL( expected.size(), remaining.size() );
+    for (SphericalPointDistribution::Polygon_t::const_iterator fixiter = polygon.begin();
+        fixiter != polygon.end(); ++fixiter) {
+      for (SphericalPointDistribution::Polygon_t::const_iterator iter = remaining.begin();
+          iter != remaining.end(); ++iter) {
+        CPPUNIT_ASSERT( (*fixiter).IsNormalTo(*iter) );
+      }
+    }
+  }
+
+  // test with three points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        Vector(1.,0.,0.),
+        Vector(-1., 0.0, 0.0),
+        Vector(0.0, 1., 0.0);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<7>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with three points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<7>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
 }
 
@@ -400,3 +829,99 @@
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
   }
+
+  // test with two points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.), Vector(-1.,0.,0.);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<8>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with two points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<8>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    // the six remaining points sit on two planes that may have been rotated arbitrarily
+    // so we cannot simply check for equality between expected and remaining
+    // hence, we just check that they are orthogonal to the first two points
+    CPPUNIT_ASSERT_EQUAL( expected.size(), remaining.size() );
+    for (SphericalPointDistribution::Polygon_t::const_iterator fixiter = polygon.begin();
+        fixiter != polygon.end(); ++fixiter) {
+      SphericalPointDistribution::Polygon_t::const_iterator expectiter = expected.begin();
+      SphericalPointDistribution::Polygon_t::const_iterator remainiter = remaining.begin();
+      for (;remainiter != remaining.end(); ++expectiter, ++remainiter) {
+        // check that points in expected/remaining have same angle to the given ones
+//        CPPUNIT_ASSERT_EQUAL( (*expectiter).Angle(*fixiter), (*remainiter).Angle(*fixiter) );
+        CPPUNIT_ASSERT( fabs( (*expectiter).Angle(*fixiter) - (*remainiter).Angle(*fixiter) )
+            < std::numeric_limits<double>::epsilon()*1e4 );
+      }
+    }
+  }
+
+  // test with three points, matching trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        Vector(1.,0.,0.),
+        Vector(-1., 0.0, 0.0),
+        Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<8>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
+
+  // test with three points, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon +=
+        RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI),
+        RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<8>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    expected.pop_front(); // remove third point
+    for (SphericalPointDistribution::Polygon_t::iterator iter = expected.begin();
+        iter != expected.end(); ++iter)
+      *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+  }
 }
