more ai generated doc with human review
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
/*! \file piquaternion.h
|
||||
* \ingroup Math
|
||||
* \~\brief
|
||||
* \~english Quaternion
|
||||
* \~russian Кватернион
|
||||
*/
|
||||
//! \addtogroup Math
|
||||
//! \{
|
||||
//! \file piquaternion.h
|
||||
//! \brief
|
||||
//! \~english Quaternion
|
||||
//! \~russian Кватернион
|
||||
//! \details
|
||||
//! \~english Quaternion for 3D rotations and orientations
|
||||
//! \~russian Кватернион для 3D вращений и ориентаций
|
||||
//! \}
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Class for quaternions
|
||||
@@ -28,29 +32,69 @@
|
||||
|
||||
#include "pimathmatrix.h"
|
||||
|
||||
//! \~english Quaternion for representing 3D rotations and orientations
|
||||
//! \~russian Кватернион для представления 3D вращений и ориентаций
|
||||
class PIP_EXPORT PIQuaternion {
|
||||
friend PIP_EXPORT PIQuaternion operator*(const PIQuaternion & q0, const PIQuaternion & q1);
|
||||
friend PIP_EXPORT PIQuaternion operator*(const double & a, const PIQuaternion & q);
|
||||
|
||||
public:
|
||||
//! \~english Construct quaternion from rotation axis and angle
|
||||
//! \~russian Создать кватернион из оси вращения и угла
|
||||
PIQuaternion(const PIMathVectorT3d & u = PIMathVectorT3d(), double a = 0.);
|
||||
|
||||
//! \~english Returns conjugate of this quaternion (negated vector part)
|
||||
//! \~russian Возвращает сопряженный кватернион (с инвертированной векторной частью)
|
||||
PIQuaternion conjugate() const { return PIQuaternion(-vector(), scalar()); }
|
||||
|
||||
//! \~english Returns new quaternion rotated around axis u by angle a
|
||||
//! \~russian Возвращает новый кватернион, повернутый вокруг оси u на угол a
|
||||
PIQuaternion rotated(const PIMathVectorT3d & u, double a) const;
|
||||
|
||||
//! \~english Rotate this quaternion around axis u by angle a
|
||||
//! \~russian Повернуть этот кватернион вокруг оси u на угол a
|
||||
void rotate(const PIMathVectorT3d & u, double a);
|
||||
|
||||
//! \~english Normalize quaternion to unit length
|
||||
//! \~russian Нормализовать кватернион к единичной длине
|
||||
void normalize();
|
||||
|
||||
//! Get/Set scalar component
|
||||
double & scalar() { return q[0]; }
|
||||
|
||||
//! Get scalar component
|
||||
double scalar() const { return q[0]; }
|
||||
|
||||
//! \~english Returns vector part of quaternion
|
||||
//! \~russian Возвращает векторную часть кватерниона
|
||||
PIMathVectorT3d vector() const { return PIMathVectorT3d({q[1], q[2], q[3]}); }
|
||||
|
||||
//! \~english Returns Euler angles from quaternion
|
||||
//! \~russian Возвращает углы Эйлера из кватерниона
|
||||
PIMathVectorT3d eyler() const;
|
||||
|
||||
//! \~english Returns 3x3 rotation matrix from quaternion
|
||||
//! \~russian Возвращает матрицу вращения 3x3 из кватерниона
|
||||
PIMathMatrixT33d rotationMatrix() const;
|
||||
|
||||
//! \~english Extracts rotation axis from quaternion
|
||||
//! \~russian Извлекает ось вращения из кватерниона
|
||||
void axis(PIMathVectorT3d * ret) const;
|
||||
|
||||
//! \~english Create quaternion from Euler angles (roll, pitch, yaw)
|
||||
//! \~russian Создать кватернион из углов Эйлера (крен, тангаж, рыскание)
|
||||
static PIQuaternion fromEyler(double ax, double ay, double az);
|
||||
|
||||
//! \~english Create quaternion from 3x3 rotation matrix
|
||||
//! \~russian Создать кватернион из матрицы вращения 3x3
|
||||
static PIQuaternion fromRotationMatrix(const PIMathMatrixT33d & m);
|
||||
|
||||
//! \~english Create quaternion from rotation angles
|
||||
//! \~russian Создать кватернион из углов поворота
|
||||
static PIQuaternion fromAngles(double ax, double ay, double az);
|
||||
|
||||
//! \~english Create quaternion from rotation angles (alternative method)
|
||||
//! \~russian Создать кватернион из углов поворота (альтернативный метод)
|
||||
static PIQuaternion fromAngles2(double ax, double ay, double az);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user