dune-functions 2.9.0
trigonometricfunction.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
5
6#include <cmath>
7
8namespace Dune {
9namespace Functions {
10
11
12
25template<class K, int sinFactor, int cosFactor>
27{
28public:
30 K operator () (const K& x) const
31 {
32 return sinFactor * std::sin(x) + cosFactor * std::cos(x);
33 }
34};
35
36
38template<class K, int sinFactor, int cosFactor>
40{
41 return TrigonometricFunction<K, -cosFactor, sinFactor>();
42}
43
44
45
46}} // namespace Dune::Functions
47
48
49
50#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition: trigonometricfunction.hh:39
Definition: polynomial.hh:10
A linear combination of trigonomic functions.
Definition: trigonometricfunction.hh:27
K operator()(const K &x) const
Evaluate function.
Definition: trigonometricfunction.hh:30