1 #ifndef __JMATH__JTRIGONOMETRIC__
2 #define __JMATH__JTRIGONOMETRIC__
16 namespace JPP {
using namespace JMATH; }
33 typedef double (*
pF)(double);
44 if (f1 != sin && f1 != cos) {
45 throw JException(
"Invalid trigonometric function.");
113 throw JException(
"Invalid trigonometric function.");
129 throw JException(
"Invalid trigonometric function.");
144 if (in >>
object.
factor >> buffer) {
147 else if (buffer ==
"cos")
150 throw JException(
"Invalid trigonometric function.");
166 out <<
object.factor;
168 if (
object.
f1 == sin)
170 else if (
object.
f1 == cos)
173 throw JException(
"Invalid trigonometric function.");
double operator()(const double x) const
Function value.
double(* pF)(double)
Type definition of pointer to trigonometric function.
double getIntegral(const double x) const
Integral value.
JTrigonometric(pF f1, const double factor=1.0)
Constructor.
friend std::istream & operator>>(std::istream &in, JTrigonometric &object)
Read trigonometric from input.
JTrigonometric getIntegral() const
Integral function.
Trigonometric function object for sin and cos.
double getValue(const double x) const
Function value.
double getDerivative(const double x) const
Derivative value.
friend std::ostream & operator<<(std::ostream &out, const JTrigonometric &object)
Write trigonometric to output.
JTrigonometric getDerivative() const
Derivative function.