Flow123d  jenkins-Flow123d-linux-release-multijob-282
mathfce.cpp
Go to the documentation of this file.
1 #include <cmath>
3 
4 
5 bool mathfce::IsZero(double x)
6 {
7  if (fabs(x) < epsilon)
8  return true;
9  return false;
10 }
11 
12 bool mathfce::IsEqual(double x, double y)
13 {
14  if (fabs(x - y) < epsilon)
15  return true;
16  return false;
17 }
18 
19 
20 double Determinant3( double a[ 3 ][ 3 ] )
21 {
22  double rc;
23  rc = a[ 0 ][ 0 ] * a[ 1 ][ 1 ] * a[ 2 ][ 2 ]
24  + a[ 1 ][ 0 ] * a[ 2 ][ 1 ] * a[ 0 ][ 2 ]
25  + a[ 2 ][ 0 ] * a[ 0 ][ 1 ] * a[ 1 ][ 2 ]
26  - a[ 0 ][ 2 ] * a[ 1 ][ 1 ] * a[ 2 ][ 0 ]
27  - a[ 1 ][ 2 ] * a[ 2 ][ 1 ] * a[ 0 ][ 0 ]
28  - a[ 2 ][ 2 ] * a[ 0 ][ 1 ] * a[ 1 ][ 0 ];
29  return rc;
30 }
31 
bool IsZero(double)
Definition: mathfce.cpp:5
double Determinant3(double[3][3])
Definition: mathfce.cpp:20
const double epsilon
Definition: mathfce.h:6
bool IsEqual(double, double)
Definition: mathfce.cpp:12