Index: src/Potentials/Makefile.am
===================================================================
--- src/Potentials/Makefile.am	(revision 51c50212088ce597a85bc85518b56a26abdaa7d1)
+++ src/Potentials/Makefile.am	(revision a63187fab0bcc6fe01a865d33aa72b07de608851)
@@ -4,4 +4,5 @@
 POTENTIALSSOURCE = \
   Potentials/Specifics/ManyBodyPotential_Tersoff.cpp \
+  Potentials/Specifics/PairPotential_Angle.cpp \
   Potentials/Specifics/PairPotential_Harmonic.cpp \
   Potentials/Specifics/PairPotential_Morse.cpp
@@ -11,4 +12,5 @@
   Potentials/helpers.hpp \
   Potentials/Specifics/ManyBodyPotential_Tersoff.hpp \
+  Potentials/Specifics/PairPotential_Angle.hpp \
   Potentials/Specifics/PairPotential_Harmonic.hpp \
   Potentials/Specifics/PairPotential_Morse.hpp
Index: src/Potentials/Specifics/PairPotential_Angle.cpp
===================================================================
--- src/Potentials/Specifics/PairPotential_Angle.cpp	(revision a63187fab0bcc6fe01a865d33aa72b07de608851)
+++ src/Potentials/Specifics/PairPotential_Angle.cpp	(revision a63187fab0bcc6fe01a865d33aa72b07de608851)
@@ -0,0 +1,148 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the COPYING file or "Copyright notice" in builder.cpp for details.
+ * 
+ *
+ *   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_Angle.cpp
+ *
+ *  Created on: Oct 11, 2012
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "PairPotential_Angle.hpp"
+
+#include "CodePatterns/Assert.hpp"
+
+#include "Potentials/helpers.hpp"
+
+PairPotential_Angle::PairPotential_Angle() :
+  params(parameters_t(MAXPARAMS, 0.))
+{}
+
+PairPotential_Angle::PairPotential_Angle(
+    const double _spring_constant,
+    const double _equilibrium_distance,
+    const double _energy_offset) :
+      params(parameters_t(MAXPARAMS, 0.))
+{
+  params[spring_constant] = _spring_constant;
+  params[equilibrium_distance] = _equilibrium_distance;
+  params[energy_offset] = _energy_offset;
+}
+
+PairPotential_Angle::result_t
+PairPotential_Angle::function_theta(
+    const double &r_ij,
+    const double &r_ik,
+    const double &r_jk
+  ) const
+{
+//  Info info(__func__);
+  const double angle = Helpers::pow(r_ij,2) + Helpers::pow(r_ik,2) - Helpers::pow(r_jk,2);
+  const double divisor = 2.* r_ij * r_ik;
+
+//  LOG(2, "DEBUG: cos(theta)= " << angle/divisor);
+  if (divisor == 0.)
+    return 0.;
+  else
+    return angle/divisor;
+}
+
+PairPotential_Angle::results_t
+PairPotential_Angle::operator()(
+    const arguments_t &arguments
+    ) const
+{
+  ASSERT( arguments.size() == 3,
+      "PairPotential_Angle::operator() - requires exactly three arguments.");
+  const argument_t &r_ij = arguments[0];
+  const argument_t &r_ik = arguments[1];
+  const argument_t &r_jk = arguments[2];
+  const result_t result =
+      params[spring_constant]
+             * Helpers::pow( function_theta(r_ij.distance, r_ik.distance, r_jk.distance) - params[equilibrium_distance], 2 )
+            + params[energy_offset];
+  return std::vector<result_t>(1, result);
+}
+
+PairPotential_Angle::derivative_components_t
+PairPotential_Angle::derivative(
+    const arguments_t &arguments
+    ) const
+{
+  ASSERT( arguments.size() == 3,
+      "PairPotential_Angle::operator() - requires exactly three arguments.");
+  derivative_components_t result;
+  const argument_t &r_ij = arguments[0];
+  result.push_back( 2. * params[spring_constant] * ( r_ij.distance - params[equilibrium_distance]) );
+  ASSERT( result.size() == 1,
+      "PairPotential_Angle::operator() - we did not create exactly one component.");
+  return result;
+}
+
+PairPotential_Angle::results_t
+PairPotential_Angle::parameter_derivative(
+    const arguments_t &arguments,
+    const size_t index
+    ) const
+{
+  ASSERT( arguments.size() == 3,
+      "PairPotential_Angle::parameter_derivative() - requires exactly three arguments.");
+  const argument_t &r_ij = arguments[0];
+  const argument_t &r_ik = arguments[1];
+  const argument_t &r_jk = arguments[2];
+  switch (index) {
+    case spring_constant:
+    {
+      const result_t result =
+                 Helpers::pow( function_theta(r_ij.distance, r_ik.distance, r_jk.distance) - params[equilibrium_distance], 2 );
+      return std::vector<result_t>(1, result);
+      break;
+    }
+    case equilibrium_distance:
+    {
+      const result_t result =
+          -2. * params[spring_constant]
+                 * ( function_theta(r_ij.distance, r_ik.distance, r_jk.distance) - params[equilibrium_distance]);
+      return std::vector<result_t>(1, result);
+      break;
+    }
+    case energy_offset:
+    {
+      const result_t result = +1.;
+      return std::vector<result_t>(1, result);
+      break;
+    }
+    default:
+      break;
+  }
+
+  return PairPotential_Angle::results_t(1, 0.);
+}
Index: src/Potentials/Specifics/PairPotential_Angle.hpp
===================================================================
--- src/Potentials/Specifics/PairPotential_Angle.hpp	(revision a63187fab0bcc6fe01a865d33aa72b07de608851)
+++ src/Potentials/Specifics/PairPotential_Angle.hpp	(revision a63187fab0bcc6fe01a865d33aa72b07de608851)
@@ -0,0 +1,150 @@
+/*
+ * PairPotential_Angle.hpp
+ *
+ *  Created on: Oct 11, 2012
+ *      Author: heber
+ */
+
+#ifndef PAIRPOTENTIAL_ANGLE_HPP_
+#define PAIRPOTENTIAL_ANGLE_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <limits>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "Potentials/EmpiricalPotential.hpp"
+#include "FunctionApproximation/FunctionModel.hpp"
+
+/** This is the implementation of a harmonic angle potential.
+ *
+ * This evaluates \f$ k \cdot (\theta -\theta_0)^2 \f$.
+ *
+ */
+class PairPotential_Angle : virtual public EmpiricalPotential, virtual public FunctionModel
+{
+  //!> grant unit test access to internal parts
+  friend class PairPotential_AngleTest;
+  // some repeated typedefs to avoid ambiguities
+  typedef FunctionModel::arguments_t arguments_t;
+  typedef FunctionModel::result_t result_t;
+  typedef FunctionModel::results_t results_t;
+  typedef EmpiricalPotential::derivative_components_t derivative_components_t;
+  typedef FunctionModel::parameters_t parameters_t;
+public:
+  PairPotential_Angle();
+  PairPotential_Angle(
+      const double _spring_constant,
+      const double _equilibrium_distance,
+      const double _energy_offset);
+  virtual ~PairPotential_Angle() {}
+
+  /** Setter for parameters as required by FunctionModel interface.
+   *
+   * \param _params given set of parameters
+   */
+  void setParameters(const parameters_t &_params)
+  {
+    ASSERT( _params.size() <= getParameterDimension(),
+        "PairPotential_Angle::setParameters() - we need not more than "
+        +toString(getParameterDimension())+" parameters.");
+    for(size_t i=0;i<_params.size();++i)
+      params[i] = _params[i];
+  }
+
+  /** Getter for parameters as required by FunctionModel interface.
+   *
+   * \return set of parameters
+   */
+  parameters_t getParameters() const
+  {
+    return params;
+  }
+
+  /** Getter for the number of parameters of this model function.
+   *
+   * \return number of parameters
+   */
+  size_t getParameterDimension() const
+  {
+    return 3;
+  }
+
+  /** Evaluates the harmonic potential function for the given arguments.
+   *
+   * @param arguments single distance
+   * @return value of the potential function
+   */
+  results_t operator()(const arguments_t &arguments) const;
+
+  /** Evaluates the derivative of the potential function.
+   *
+   * @param arguments single distance
+   * @return vector with derivative with respect to the input degrees of freedom
+   */
+  derivative_components_t derivative(const arguments_t &arguments) const;
+
+  /** Evaluates the derivative of the function with the given \a arguments
+   * with respect to a specific parameter indicated by \a index.
+   *
+   * \param arguments set of arguments as input variables to the function
+   * \param index derivative of which parameter
+   * \return result vector containing the derivative with respect to the given
+   *         input
+   */
+  results_t parameter_derivative(const arguments_t &arguments, const size_t index) const;
+
+  /** States whether lower and upper boundaries should be used to constraint
+   * the parameter search for this function model.
+   *
+   * \return true - constraints should be used, false - else
+   */
+  bool isBoxConstraint() const {
+    return true;
+  }
+
+  /** Returns a vector which are the lower boundaries for each parameter_t
+   * of this FunctionModel.
+   *
+   * \return vector of parameter_t resembling lowest allowed values
+   */
+  parameters_t getLowerBoxConstraints() const {
+    parameters_t lowerbounds(getParameterDimension(), -std::numeric_limits<double>::max());
+    lowerbounds[equilibrium_distance] = 0.;
+    return lowerbounds;
+  }
+
+  /** Returns a vector which are the upper boundaries for each parameter_t
+   * of this FunctionModel.
+   *
+   * \return vector of parameter_t resembling highest allowed values
+   */
+  parameters_t getUpperBoxConstraints() const {
+    return parameters_t(getParameterDimension(), std::numeric_limits<double>::max());
+  }
+
+  enum parameter_enum_t {
+    spring_constant=0,
+    equilibrium_distance=1,
+    energy_offset=2,
+    MAXPARAMS
+  };
+
+private:
+  result_t
+  function_theta(
+      const double &r_ij,
+      const double &r_ik,
+      const double &r_jk
+    ) const;
+private:
+  //!> parameter vector with parameters as in enum parameter_enum_t
+  parameters_t params;
+};
+
+#endif /* PAIRPOTENTIAL_ANGLE_HPP_ */
