CoTanPotentialFunctions.cpp
Go to the documentation of this file.
00001 /*
00002  * CoTanPotentialFunctions.cpp
00003  *
00004  *  Created on: Sep 10, 2012
00005  *      Author: mriedel
00006  */
00007 
00008 #include <telekyb_calculus/Potentials/CoTanPotentialFunctions.hpp>
00009 
00010 namespace TELEKYB_NAMESPACE {
00011 
00012 CoTanRepulsiveGradient::CoTanRepulsiveGradient(const std::string& potentialFunctionName_)
00013         : PotentialFunction(potentialFunctionName_, PotentialFunctionType::Repulsive)
00014 {
00015 
00016 }
00017 
00018 CoTanRepulsiveGradient::CoTanRepulsiveGradient(const std::string& potentialFunctionName_,
00019                 double tPotFuncZeroD_, double tPotFuncInfD_, double tPotFuncSatValue_, double tPotFuncGain_)
00020 : PotentialFunction(potentialFunctionName_, PotentialFunctionType::Repulsive,
00021                 tPotFuncZeroD_, tPotFuncInfD_, tPotFuncSatValue_, tPotFuncGain_)
00022 {
00023 
00024 }
00025 
00026 double CoTanRepulsiveGradient::getPotentialImpl(double d) const {
00027         double z = (M_PI/2.0) *
00028                         ((d - options.tPotFuncInfD->getValue())
00029                                         / (options.tPotFuncZeroD->getValue() - options.tPotFuncInfD->getValue()));
00030         double cot_z = cos(z)/sin(z);
00031         double retValue = (M_PI/2.0) * (1.0 / (options.tPotFuncZeroD->getValue() - options.tPotFuncInfD->getValue())) *
00032                         (cot_z + z - (M_PI/2.0));
00033 //                      pow((cot_z + z - (M_PI/2.0)),options.tPotFuncGain->getValue());
00034         return options.tPotFuncGain->getValue() * retValue;
00035 }
00036 
00037 
00038 CoTanAttractiveGradient::CoTanAttractiveGradient(const std::string& potentialFunctionName_)
00039         : PotentialFunction(potentialFunctionName_, PotentialFunctionType::Attractive)
00040 {
00041 
00042 }
00043 
00044 CoTanAttractiveGradient::CoTanAttractiveGradient(const std::string& potentialFunctionName_,
00045                 double tPotFuncZeroD_, double tPotFuncInfD_, double tPotFuncSatValue_, double tPotFuncGain_)
00046 : PotentialFunction(potentialFunctionName_, PotentialFunctionType::Attractive,
00047                 tPotFuncZeroD_, tPotFuncInfD_, tPotFuncSatValue_, tPotFuncGain_)
00048 {
00049 
00050 }
00051 
00052 double CoTanAttractiveGradient::getPotentialImpl(double d) const {
00053         double z = (M_PI/2.0) *
00054                         ((options.tPotFuncInfD->getValue() - d)
00055                                         / (options.tPotFuncInfD->getValue() - options.tPotFuncZeroD->getValue()));
00056         double cot_z = cos(z)/sin(z);
00057         double retValue = (M_PI/2.0) * (1.0 / (options.tPotFuncInfD->getValue() - options.tPotFuncZeroD->getValue())) *
00058                         (cot_z + z - (M_PI/2.0));
00059 //                      pow((cot_z + z - (M_PI/2.0)),options.tPotFuncGain->getValue());
00060         return options.tPotFuncGain->getValue() * retValue;
00061 }
00062 
00063 
00064 } /* namespace telekyb */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Defines


telekyb_calculus
Author(s): Martin Riedel
autogenerated on Mon Nov 11 2013 11:13:18