IT++ Logo
trig_hyp.h
Go to the documentation of this file.
1
29#ifndef TRIG_HYP_H
30#define TRIG_HYP_H
31
33#include <itpp/itexports.h>
34
35namespace itpp
36{
37
40
42inline double sinc(double x)
43{
44 if (x == 0) {
45 return 1.0;
46 }
47 else {
48 double pix = itpp::pi * x;
49 return sin(pix) / pix;
50 }
51}
52
54inline vec sin(const vec &x) { return apply_function<double>(std::sin, x); }
56inline mat sin(const mat &x) { return apply_function<double>(std::sin, x); }
58inline vec cos(const vec &x) { return apply_function<double>(std::cos, x); }
60inline mat cos(const mat &x) { return apply_function<double>(std::cos, x); }
62inline vec tan(const vec &x) { return apply_function<double>(std::tan, x); }
64inline mat tan(const mat &x) { return apply_function<double>(std::tan, x); }
66inline vec asin(const vec &x) { return apply_function<double>(std::asin, x); }
68inline mat asin(const mat &x) { return apply_function<double>(std::asin, x); }
70inline vec acos(const vec &x) { return apply_function<double>(std::acos, x); }
72inline mat acos(const mat &x) { return apply_function<double>(std::acos, x); }
74inline vec atan(const vec &x) { return apply_function<double>(std::atan, x); }
76inline mat atan(const mat &x) { return apply_function<double>(std::atan, x); }
78inline vec sinc(const vec &x) { return apply_function<double>(sinc, x); }
80inline mat sinc(const mat &x) { return apply_function<double>(sinc, x); }
81
83
84
87
89inline vec sinh(const vec &x) { return apply_function<double>(std::sinh, x); }
91inline mat sinh(const mat &x) { return apply_function<double>(std::sinh, x); }
93inline vec cosh(const vec &x) { return apply_function<double>(std::cosh, x); }
95inline mat cosh(const mat &x) { return apply_function<double>(std::cosh, x); }
97inline vec tanh(const vec &x) { return apply_function<double>(std::tanh, x); }
99inline mat tanh(const mat &x) { return apply_function<double>(std::tanh, x); }
101ITPP_EXPORT vec asinh(const vec &x);
103ITPP_EXPORT mat asinh(const mat &x);
105ITPP_EXPORT vec acosh(const vec &x);
107ITPP_EXPORT mat acosh(const mat &x);
109ITPP_EXPORT vec atanh(const vec &x);
111ITPP_EXPORT mat atanh(const mat &x);
112
114
115} // namespace itpp
116
117#endif // #ifndef TRIG_HYP_H
vec asinh(const vec &x)
Inverse sine hyperbolic function.
Definition trig_hyp.cpp:36
vec tanh(const vec &x)
Tan hyperbolic function.
Definition trig_hyp.h:97
vec sinh(const vec &x)
Sine hyperbolic function.
Definition trig_hyp.h:89
vec cosh(const vec &x)
Cosine hyperbolic function.
Definition trig_hyp.h:93
vec acosh(const vec &x)
Inverse cosine hyperbolic function.
Definition trig_hyp.cpp:40
vec atanh(const vec &x)
Inverse tan hyperbolic function.
Definition trig_hyp.cpp:44
Vec< T > apply_function(T(*f)(T), const Vec< T > &v)
Help function to call for a function: Vec<T> function(Vec<T>)
vec sin(const vec &x)
Sine function.
Definition trig_hyp.h:54
vec cos(const vec &x)
Cosine function.
Definition trig_hyp.h:58
vec tan(const vec &x)
Tan function.
Definition trig_hyp.h:62
vec asin(const vec &x)
Inverse sine function.
Definition trig_hyp.h:66
vec atan(const vec &x)
Inverse tan function.
Definition trig_hyp.h:74
double sinc(double x)
Sinc function: sinc(x) = sin(pi*x)/pi*x.
Definition trig_hyp.h:42
vec acos(const vec &x)
Inverse cosine function.
Definition trig_hyp.h:70
Help functions to make functions with vec and mat as arguments.
itpp namespace
Definition itmex.h:37
const double pi
Constant Pi.
Definition misc.h:103

Generated on Tue Aug 17 2021 10:59:15 for IT++ by Doxygen 1.12.0