Index: src/Potentials/Specifics/PairPotential_Angle.cpp
===================================================================
--- src/Potentials/Specifics/PairPotential_Angle.cpp	(revision a63187fab0bcc6fe01a865d33aa72b07de608851)
+++ src/Potentials/Specifics/PairPotential_Angle.cpp	(revision c92c0df7ac9f5f1d576b4ab1e1fd3d9ab54a53bc)
@@ -102,5 +102,7 @@
   derivative_components_t result;
   const argument_t &r_ij = arguments[0];
-  result.push_back( 2. * params[spring_constant] * ( r_ij.distance - params[equilibrium_distance]) );
+  const argument_t &r_ik = arguments[1];
+  const argument_t &r_jk = arguments[2];
+  result.push_back( 2. * params[spring_constant] * ( function_theta(r_ij.distance, r_ik.distance, r_jk.distance) - params[equilibrium_distance]) );
   ASSERT( result.size() == 1,
       "PairPotential_Angle::operator() - we did not create exactly one component.");
Index: src/Potentials/Specifics/unittests/Makefile.am
===================================================================
--- src/Potentials/Specifics/unittests/Makefile.am	(revision a63187fab0bcc6fe01a865d33aa72b07de608851)
+++ src/Potentials/Specifics/unittests/Makefile.am	(revision c92c0df7ac9f5f1d576b4ab1e1fd3d9ab54a53bc)
@@ -4,4 +4,5 @@
 POTENTIALSSPECIFICSTESTSSOURCES = \
 	../Potentials/Specifics/unittests/ManyBodyPotential_TersoffUnitTest.cpp \
+	../Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp \
 	../Potentials/Specifics/unittests/PairPotential_HarmonicUnitTest.cpp \
 	../Potentials/Specifics/unittests/PairPotential_MorseUnitTest.cpp
@@ -9,4 +10,5 @@
 POTENTIALSSPECIFICSTESTSHEADERS = \
 	../Potentials/Specifics/unittests/ManyBodyPotential_TersoffUnitTest.hpp \
+	../Potentials/Specifics/unittests/PairPotential_AngleUnitTest.hpp \
 	../Potentials/Specifics/unittests/PairPotential_HarmonicUnitTest.hpp \
 	../Potentials/Specifics/unittests/PairPotential_MorseUnitTest.hpp
@@ -14,4 +16,5 @@
 POTENTIALSSPECIFICSTESTS = \
 	ManyBodyPotential_TersoffUnitTest \
+	PairPotential_AngleUnitTest \
 	PairPotential_HarmonicUnitTest \
 	PairPotential_MorseUnitTest
@@ -33,4 +36,9 @@
 ManyBodyPotential_TersoffUnitTest_LDADD = ${POTENTIALSSPECIFICSLIBS}
 
+PairPotential_AngleUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp \
+	../Potentials/Specifics/unittests/PairPotential_AngleUnitTest.hpp
+PairPotential_AngleUnitTest_LDADD = ${POTENTIALSSPECIFICSLIBS}
+
 PairPotential_HarmonicUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
 	../Potentials/Specifics/unittests/PairPotential_HarmonicUnitTest.cpp \
Index: src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp
===================================================================
--- src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp	(revision c92c0df7ac9f5f1d576b4ab1e1fd3d9ab54a53bc)
+++ src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp	(revision c92c0df7ac9f5f1d576b4ab1e1fd3d9ab54a53bc)
@@ -0,0 +1,168 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * PairPotential_AngleUnitTest.cpp
+ *
+ *  Created on: Oct 16, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "PairPotential_AngleUnitTest.hpp"
+
+#include <boost/assign.hpp>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "FunctionApproximation/FunctionArgument.hpp"
+#include "Potentials/Specifics/PairPotential_Angle.hpp"
+#include "Potentials/helpers.hpp"
+
+using namespace boost::assign;
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( PairPotential_AngleTest );
+
+
+void PairPotential_AngleTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  // create three distances to have the desired angle
+  typedef std::vector<double> angles_t;
+  angles_t angles;
+  angles += -0.5, -.4, -.3, -.2, -.1, 0., .1, .2, .3, .4, .5;
+  FunctionModel::arguments_t tempvector(3);
+  tempvector[0] = argument_t( std::make_pair(0,1), 1.);
+  tempvector[1] = argument_t( std::make_pair(0,2), 1.);
+  tempvector[2] = argument_t( std::make_pair(1,2), 0.);
+  for (angles_t::const_iterator iter = angles.begin(); iter != angles.end(); ++iter) {
+    tempvector[2].distance = sqrt(-(2.*(*iter)-2.));//1.+1.-x/(2.*1.*1.)
+    input += tempvector;
+  }
+  output +=
+      .5*0.25+.1,
+      .5*0.16+.1,
+      .5*0.09+.1,
+      .5*0.04+.1,
+      .5*0.01+.1,
+      .5*0.+.1,
+      .5*0.01+.1,
+      .5*0.04+.1,
+      .5*0.09+.1,
+      .5*0.16+.1,
+      .5*0.25+.1;
+
+  CPPUNIT_ASSERT_EQUAL( input.size(), output.size() );
+}
+
+
+void PairPotential_AngleTest::tearDown()
+{
+}
+
+/** UnitTest for operator()
+ */
+void PairPotential_AngleTest::operatorTest()
+{
+  PairPotential_Angle angle(.5,0.,.1);
+  for (size_t index = 0; index < input.size(); ++index) {
+    CPPUNIT_ASSERT(
+        Helpers::isEqual(
+            output[index],
+            angle( input[index] )[0]
+        )
+    );
+  }
+}
+
+/** UnitTest for derivative()
+ */
+void PairPotential_AngleTest::derivativeTest()
+{
+  PairPotential_Angle angle(.5,0.,.1);
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          0.,
+          angle.derivative(
+              input[5]
+          )[0],
+          10.
+      )
+  );
+}
+
+
+/** UnitTest for parameter_derivative()
+ */
+void PairPotential_AngleTest::parameter_derivativeTest()
+{
+  PairPotential_Angle angle(.5,0.,.1);
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          0.,
+          angle.parameter_derivative(
+              input[5],
+              0
+          )[0],
+          10.
+      )
+  );
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          0.,
+          angle.parameter_derivative(
+              input[5],
+              1
+          )[0],
+          10.
+      )
+  );
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          1.,
+          angle.parameter_derivative(
+              input[5],
+              2
+          )[0],
+          10.
+      )
+  );
+}
Index: src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.hpp
===================================================================
--- src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.hpp	(revision c92c0df7ac9f5f1d576b4ab1e1fd3d9ab54a53bc)
+++ src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.hpp	(revision c92c0df7ac9f5f1d576b4ab1e1fd3d9ab54a53bc)
@@ -0,0 +1,46 @@
+/*
+ * PairPotential_AngleUnitTest.hpp
+ *
+ *  Created on: Oct 16, 2012
+ *      Author: heber
+ */
+
+#ifndef PAIRPOTENTIAL_ANGLEUNITTEST_HPP_
+#define PAIRPOTENTIAL_ANGLEUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "FunctionApproximation/FunctionModel.hpp"
+
+class PairPotential_Angle;
+
+/********************************************** Test classes **************************************/
+
+class PairPotential_AngleTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( PairPotential_AngleTest) ;
+    CPPUNIT_TEST ( operatorTest );
+    CPPUNIT_TEST ( derivativeTest );
+    CPPUNIT_TEST ( parameter_derivativeTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void operatorTest();
+      void derivativeTest();
+      void parameter_derivativeTest();
+
+private:
+      typedef std::vector<double> data_t;
+      std::vector<FunctionModel::arguments_t> input;
+      data_t output;
+};
+
+#endif /* PAIRPOTENTIAL_ANGLEUNITTEST_HPP_ */
