dune-functions  2.5.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 
7 namespace Dune {
8 namespace Functions {
9 
10 
11 
24 template<class K, int sinFactor, int cosFactor>
26 {
27 public:
29  K operator () (const K& x) const
30  {
31  return sinFactor * std::sin(x) + cosFactor * std::cos(x);
32  }
33 };
34 
35 
37 template<class K, int sinFactor, int cosFactor>
39 {
40  return TrigonometricFunction<K, -cosFactor, sinFactor>();
41 }
42 
43 
44 
45 }} // namespace Dune::Functions
46 
47 
48 
49 #endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
A linear combination of trigonomic functions.
Definition: trigonometricfunction.hh:25
Definition: polynomial.hh:7
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition: trigonometricfunction.hh:38
K operator()(const K &x) const
Evaluate function.
Definition: trigonometricfunction.hh:29