RayZaler 0.1
The free opto-mechanical simulation framework
IncrementalRotation.h
1//
2// Copyright (c) 2024 Gonzalo José Carracedo Carballal
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as
6// published by the Free Software Foundation, either version 3 of the
7// License, or (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful, but
10// WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public
15// License along with this program. If not, see
16// <http://www.gnu.org/licenses/>
17//
18
19#ifndef _INCREMENTAL_ROTATION_H
20#define _INCREMENTAL_ROTATION_H
21
22#include "Matrix.h"
23
24namespace RZ {
26 Matrix3 m_R, m_Q, m_sinK, m_oneminuscosK2;
27 Vec3 m_k;
28 Real m_theta;
29
30 static Vec3 S12(Vec3 const &);
31 void toRodrigues();
32
33 public:
35
36 inline Vec3
37 k() const
38 {
39 return m_k;
40 }
41
42 inline Real
43 theta() const
44 {
45 return m_theta;
46 }
47
48 inline Matrix3
49 matrix() const
50 {
51 return m_R;
52 }
53
54 void rotateRelative(Vec3 const &vec, Real theta);
55 void rotate(Vec3 const &vec, Real theta);
56 void rotate(Matrix3 const &R);
57 void rotate(IncrementalRotation const &);
58
59 void setRotation(Vec3 const &vec, Real theta);
60 void setRotation(Matrix3 const &R);
61 void setAzEl(Real az, Real el);
62 };
63}
64
65#endif // _INCREMENTAL_ROTATION_H
Definition: IncrementalRotation.h:25
Definition: Matrix.h:48
Definition: Vector.h:66