🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
AngleAxis.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstMath/Vector.hpp"
25#include "AstMath/Matrix.hpp"
26#include "AstMath/AttitudeConvert.hpp"
27
28AST_NAMESPACE_BEGIN
29
30
35{
36public:
39
43 AngleAxis(double angle, const Vector3d& axis)
44 : axis_(axis), angle_(angle){}
45
48 double angle() const { return angle_; }
49 double& angle() { return angle_; }
50
53 const Vector3d& axis() const { return axis_; }
54 Vector3d& axis() { return axis_; }
55
56
57public:
60 AngleAxis inverse() const { return AngleAxis(-angle_, axis_); }
61
62public:
63
68 aMatrixToAngleAxis(mtx, *this);
69 return *this;
70 }
71
75 Matrix3d mtx;
76 aAngleAxisToMatrix(*this, mtx);
77 return mtx;
78 }
79
80public:
81 Vector3d axis_;
82 double angle_;
83};
84
85
86
87
88
89AST_NAMESPACE_END
轴角类
定义 AngleAxis.hpp:35
const Vector3d & axis() const
获取旋转轴
定义 AngleAxis.hpp:53
AngleAxis inverse() const
获取轴角的逆旋转
定义 AngleAxis.hpp:60
AngleAxis(double angle, const Vector3d &axis)
轴角类构造函数
定义 AngleAxis.hpp:43
AngleAxis & fromRotationMatrix(const Matrix3d &mtx)
从旋转矩阵构造轴角
定义 AngleAxis.hpp:67
double angle_
旋转角度(弧度)
定义 AngleAxis.hpp:82
double angle() const
获取旋转角度(弧度)
定义 AngleAxis.hpp:48
AngleAxis()
轴角类默认构造函数,这里不进行任何初始化,也不初始化为0
定义 AngleAxis.hpp:38
Vector3d axis_
旋转轴
定义 AngleAxis.hpp:81
Matrix3d toRotationMatrix() const
轴角转旋转矩阵
定义 AngleAxis.hpp:74
void aAngleAxisToMatrix(const AngleAxis &aa, Matrix3d &mtx)
轴角转矩阵
定义 AttitudeConvert.cpp:736
void aMatrixToAngleAxis(const Matrix3d &mtx, AngleAxis &aa)
矩阵转轴角
定义 AttitudeConvert.cpp:743