GeoModel - GeoModelCore
ASin.cpp
1 //==========================================================================//
2 // Imported from the QAT library (qat.pitt.edu) by the copyright holder //
3 // Joe Boudreau. Software licensed under the terms and conditions of the //
4 // GNU Lesser Public License v3. //
5 //==========================================================================//
6 #include "GeoGenericFunctions/ASin.h"
7 #include "GeoGenericFunctions/Sqrt.h"
8 #include "GeoGenericFunctions/Square.h"
9 #include <cmath>
10 #include <stdexcept>
11 
12 namespace GeoGenfun {
13 FUNCTION_OBJECT_IMP(ASin)
14 
15 ASin::ASin()
16 {}
17 
18 ASin::~ASin() {
19 }
20 
21 ASin::ASin(const ASin & right) : AbsFunction(right)
22 { }
23 
24 
25 double ASin::operator() (double x) const {
26  return asin(x);
27 }
28 
29 
30 
31 Derivative ASin::partial(unsigned int index) const {
32  if (index!=0) throw std::range_error("ASin: partial derivative index out of range");
33 
34  Square square;
35  Sqrt root;
36 
37  const AbsFunction & fPrime = 1.0/root(1.0-square) ;
38  return Derivative(& fPrime);
39 }
40 
41 } // end namespace GeoGenFun
Definition: Abs.h:15