g4tools  5.4.0
mat3d
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_mat3d
5 #define tools_mat3d
6 
7 #include "mat3"
8 #include <cmath>
9 
10 namespace tools {
11 
12 class mat3d : public mat3<double> {
13  typedef mat3<double> parent;
14 public:
15  mat3d(){}
16  virtual ~mat3d() {}
17 public:
18  mat3d(const mat3d& a_from):parent(a_from){}
19  mat3d& operator=(const mat3d& a_from){
20  parent::operator=(a_from);
21  return *this;
22  }
23 public:
24  mat3d(double a_00,double a_01,double a_02, //first row
25  double a_10,double a_11,double a_12, //second row
26  double a_20,double a_21,double a_22) //third row
27  :parent(a_00,a_01,a_02,
28  a_10,a_11,a_12,
29  a_20,a_21,a_22)
30  {}
31  mat3d(const parent& a_from):parent(a_from){}
32  mat3d& operator=(const parent& a_from){
33  parent::operator=(a_from);
34  return *this;
35  }
36 public:
37  mat3d(const mat3<float>& a_from):parent(){
38  for(unsigned int index=0;index<9;index++) {
39  m_vec[index] = a_from.data()[index];
40  }
41  }
42  mat3d& operator=(const mat3<float>& a_from){
43  for(unsigned int index=0;index<9;index++) {
44  m_vec[index] = a_from.data()[index];
45  }
46  return *this;
47  }
48 public:
49  void set_rotate(const double& a_x,const double& a_y,const double& a_z,const double& a_angle) {
50  parent::set_rotate(a_x,a_y,a_z,a_angle,::sin,::cos);
51  }
52  void mul_rotate(const double& a_x,const double& a_y,const double& a_z,const double& a_angle) {
53  parent::mul_rotate(a_x,a_y,a_z,a_angle,::sin,::cos);
54  }
55  void left_mul_rotate(const double& a_x,const double& a_y,const double& a_z,const double& a_angle) {
56  parent::left_mul_rotate(a_x,a_y,a_z,a_angle,::sin,::cos);
57  }
58  bool get_rotate(double& a_x,double& a_y,double& a_z,double& a_angle) {
59  return parent::get_rotate(a_x,a_y,a_z,a_angle,::acos,::sin,::sqrt); //warning : acos and not cos.
60  }
61 public: //operators
62 };
63 
64 }
65 
66 #endif
tools::mat3< double >::operator=
mat3 & operator=(const mat3 &a_from)
Definition: mat3:27
tools::mat3< double >::get_rotate
bool get_rotate(double &a_x, double &a_y, double &a_z, double &a_angle, double(*a_acos)(double), double(*a_sin)(double), double(*a_sqrt)(double))
Definition: mat3:58
tools::mat3d::mat3d
mat3d(const mat3< float > &a_from)
Definition: mat3d:37
tools::mat< double, 3 >::m_vec
double m_vec[D *D]
Definition: mat:85
tools::mat3d::mul_rotate
void mul_rotate(const double &a_x, const double &a_y, const double &a_z, const double &a_angle)
Definition: mat3d:52
tools::mat3d::get_rotate
bool get_rotate(double &a_x, double &a_y, double &a_z, double &a_angle)
Definition: mat3d:58
tools::mat3d::operator=
mat3d & operator=(const mat3< float > &a_from)
Definition: mat3d:42
tools::mat3< double >::left_mul_rotate
void left_mul_rotate(const double &a_x, const double &a_y, const double &a_z, const double &a_angle, double(*a_sin)(double), double(*a_cos)(double))
Definition: mat3:130
tools::mat3d::mat3d
mat3d(const parent &a_from)
Definition: mat3d:31
tools::mat3d::operator=
mat3d & operator=(const parent &a_from)
Definition: mat3d:32
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::mat3< double >::set_rotate
void set_rotate(const double &a_x, const double &a_y, const double &a_z, const double &a_angle, double(*a_sin)(double), double(*a_cos)(double))
Definition: mat3:54
tools::mat3d::mat3d
mat3d(double a_00, double a_01, double a_02, double a_10, double a_11, double a_12, double a_20, double a_21, double a_22)
Definition: mat3d:24
mat3
tools::mat3d::operator=
mat3d & operator=(const mat3d &a_from)
Definition: mat3d:19
tools::mat3
Definition: mat3:14
tools::mat3d::mat3d
mat3d(const mat3d &a_from)
Definition: mat3d:18
tools::mat3d::set_rotate
void set_rotate(const double &a_x, const double &a_y, const double &a_z, const double &a_angle)
Definition: mat3d:49
tools::mat3d::~mat3d
virtual ~mat3d()
Definition: mat3d:16
tools::mat3d::left_mul_rotate
void left_mul_rotate(const double &a_x, const double &a_y, const double &a_z, const double &a_angle)
Definition: mat3d:55
tools::mat3< double >::mul_rotate
void mul_rotate(const double &a_x, const double &a_y, const double &a_z, const double &a_angle, double(*a_sin)(double), double(*a_cos)(double))
Definition: mat3:124
tools::mat3d
Definition: mat3d:12
tools::mat3d::mat3d
mat3d()
Definition: mat3d:15