COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
rotation.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
30 #ifndef _MATH_ROTATE_H
31 #define _MATH_ROTATE_H
32 
33 #include "support/configCosmos.h"
34 #include "vector.h"
35 #include "matrix.h"
36 // #include "quaternion.h"
37 
38 // these came from the quaternion lib because they depend on matrix types
42 // from matrix
44 
46 
50 public:
51 
52  cvector i; // = {1,0,0}
53  cvector j; // = {0,1,0}
54  cvector k; // = {0,0,1}
55 
56  void normalize();
57 };
58 
59 // TODO: rename to DirectionCosineMatrix
60 class DCM {
61 private:
62 
63 public:
64  cmatrix base2_from_base1(basisOrthonormal base2,basisOrthonormal base1);
65  cmatrix base1_from_base2(basisOrthonormal base1, basisOrthonormal base2);
66 
67  double dotProduct(cvector a, cvector b);
68  cmatrix transposeMatrix(cmatrix a);
69 };
70 
71 #endif
Orthonormal basis.
Definition: rotation.h:49
cvector k
Definition: rotation.h:54
rmatrix rm_quaternion2dcm(quaternion q)
Quaternion to row matrix Direction Cosine Matrix.
Definition: mathlib.cpp:219
3x3 element cartesian matrix
Definition: matrix.h:96
quaternion q_dcm2quaternion_cm(cmatrix dcm)
Direction Cosine Matrix to Quaternion.
Definition: rotation.cpp:100
Quaternion, scalar last, using x, y, z.
Definition: vector.h:402
long b
Definition: jpegint.h:371
3x3 element generic matrix
Definition: matrix.h:41
quaternion q_dcm2quaternion_rm(rmatrix m)
Row matrix DCM to Quaternion.
Definition: rotation.cpp:178
Headers and definitions common to all COSMOS.
cmatrix cm_quaternion2dcm(quaternion q)
Definition: rotation.cpp:51
Definition: rotation.h:60
cvector i
Definition: rotation.h:52
Definition: eci2kep_test.cpp:33
cvector j
Definition: rotation.h:53
3 element cartesian vector
Definition: vector.h:107
void normalize()
Definition: rotation.cpp:325