General Purpose Geodetic Library
Sg3dMatrixRdots.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2010-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #include <math.h>
24 #include <Sg3dMatrixRdots.h>
25 
26 
27 /*=====================================================================================================*/
28 /* */
29 /* Sg3dMatrixRdot implementation */
30 /* */
31 /*=====================================================================================================*/
33 {
34  sincos(angle_=angle, &sinA_, &cosA_);
35  switch (axis_)
36  {
37  case X_AXIS:
38 /* mat[0][0]= 0.0; mat[0][1]= 0.0; mat[0][2]= 0.0; */
39 /* mat[1][0]= 0.0; */ mat[1][1]=-sinA_; mat[1][2]= cosA_;
40 /* mat[2][0]= 0.0; */ mat[2][1]=-cosA_; mat[2][2]=-sinA_;
41  break;
42  case Y_AXIS:
43  mat[0][0]=-sinA_; /* mat[0][1]= 0.0; */ mat[0][2]=-cosA_;
44 /* mat[1][0]= 0.0; mat[1][1]= 0.0; mat[1][2]= 0.0; */
45  mat[2][0]= cosA_; /* mat[2][1]= 0.0; */ mat[2][2]=-sinA_;
46  break;
47  case Z_AXIS:
48  mat[0][0]=-sinA_; mat[0][1]= cosA_; /* mat[0][2]= 0.0; */
49  mat[1][0]=-cosA_; mat[1][1]=-sinA_; /* mat[1][2]= 0.0; */
50 /* mat[2][0]= 0.0; mat[2][1]= 0.0; mat[2][2]= 0.0; */
51  break;
52  };
53  return *this;
54 };
55 /*=====================================================================================================*/
56 
57 
58 
59 /*=====================================================================================================*/
60 /* */
61 /* Sg3dMatrixR2dot implementation */
62 /* */
63 /*=====================================================================================================*/
65 {
66  sincos(angle_=angle, &sinA_, &cosA_);
67  switch (axis_)
68  {
69  case X_AXIS:
70 /* mat[0][0]= 0.0; mat[0][1]= 0.0; mat[0][2]= 0.0; */
71 /* mat[1][0]= 0.0; */ mat[1][1]=-cosA_; mat[1][2]=-sinA_;
72 /* mat[2][0]= 0.0; */ mat[2][1]= sinA_; mat[2][2]=-cosA_;
73  break;
74  case Y_AXIS:
75  mat[0][0]=-cosA_; /* mat[0][1]= 0.0; */ mat[0][2]= sinA_;
76 /* mat[1][0]= 0.0; mat[1][1]= 0.0; mat[1][2]= 0.0; */
77  mat[2][0]=-sinA_; /* mat[2][1]= 0.0; */ mat[2][2]=-cosA_;
78  break;
79  case Z_AXIS:
80  mat[0][0]=-cosA_; mat[0][1]=-sinA_; /* mat[0][2]= 0.0; */
81  mat[1][0]= sinA_; mat[1][1]=-cosA_; /* mat[1][2]= 0.0; */
82 /* mat[2][0]= 0.0; mat[2][1]= 0.0; mat[2][2]= 0.0; */
83  break;
84  };
85  return *this;
86 };
87 /*=====================================================================================================*/
88 
@ Z_AXIS
Definition: SgMathSupport.h:68
@ X_AXIS
Definition: SgMathSupport.h:68
@ Y_AXIS
Definition: SgMathSupport.h:68
const Sg3dMatrix & operator()(double)
double sinA_
Definition: Sg3dMatrixR.h:45
double angle_
An angle of rotation.
Definition: Sg3dMatrixR.h:44
double cosA_
Definition: Sg3dMatrixR.h:45
DIRECTION axis_
An axis of rotation.
Definition: Sg3dMatrixR.h:46
double angle() const
Definition: Sg3dMatrixR.h:72
const Sg3dMatrix & operator()(double)
double mat[3][3]
The 3x3 array that is storing elements of a matrix.
Definition: Sg3dMatrix.h:47