mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
committed by
Mathew Sutcliffe
parent
229d7c6068
commit
978f3c88e5
@@ -11,71 +11,72 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Math
|
||||
{
|
||||
|
||||
class CMatrix3x3;
|
||||
|
||||
/*!
|
||||
* \brief Matrix 3x1
|
||||
*/
|
||||
class CMatrix3x1 : public CMatrixBase<CMatrix3x1, 3, 1>
|
||||
{
|
||||
friend class CMatrix3x3;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Constructor
|
||||
*/
|
||||
CMatrix3x1() : CMatrixBase() {}
|
||||
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param r1
|
||||
* \param r2
|
||||
* \param r3
|
||||
*/
|
||||
CMatrix3x1(double r1, double r2, double r3) : CMatrixBase()
|
||||
namespace Math
|
||||
{
|
||||
this->m_matrix(0, 0) = r1;
|
||||
this->m_matrix(1, 0) = r2;
|
||||
this->m_matrix(2, 0) = r3;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Copy constructor
|
||||
* \param otherMatrix
|
||||
*/
|
||||
CMatrix3x1(const CMatrix3x1 &other) : CMatrixBase(other) {}
|
||||
class CMatrix3x3;
|
||||
|
||||
/*!
|
||||
* \brief Init by fill value
|
||||
* \param fillValue
|
||||
*/
|
||||
explicit CMatrix3x1(double fillValue) : CMatrixBase(fillValue) {}
|
||||
/*!
|
||||
* \brief Matrix 3x1
|
||||
*/
|
||||
class CMatrix3x1 : public CMatrixBase<CMatrix3x1, 3, 1>
|
||||
{
|
||||
friend class CMatrix3x3;
|
||||
|
||||
/*!
|
||||
* \brief Convert to vector
|
||||
* \return
|
||||
*/
|
||||
CVector3D toVector3D() const
|
||||
{
|
||||
return CVector3D(this->getElement(0, 0), this->getElement(1, 0), this->getElement(2, 0));
|
||||
}
|
||||
public:
|
||||
/*!
|
||||
* \brief Constructor
|
||||
*/
|
||||
CMatrix3x1() : CMatrixBase() {}
|
||||
|
||||
/*!
|
||||
* \brief Convert from vector
|
||||
* \return
|
||||
*/
|
||||
void fromVector3D(const CVector3D &vector)
|
||||
{
|
||||
this->m_matrix(0, 0) = vector.i();
|
||||
this->m_matrix(1, 0) = vector.j();
|
||||
this->m_matrix(2, 0) = vector.k();
|
||||
}
|
||||
};
|
||||
/*!
|
||||
* \brief Constructor
|
||||
* \param r1
|
||||
* \param r2
|
||||
* \param r3
|
||||
*/
|
||||
CMatrix3x1(double r1, double r2, double r3) : CMatrixBase()
|
||||
{
|
||||
this->m_matrix(0, 0) = r1;
|
||||
this->m_matrix(1, 0) = r2;
|
||||
this->m_matrix(2, 0) = r3;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
/*!
|
||||
* \brief Copy constructor
|
||||
* \param otherMatrix
|
||||
*/
|
||||
CMatrix3x1(const CMatrix3x1 &other) : CMatrixBase(other) {}
|
||||
|
||||
/*!
|
||||
* \brief Init by fill value
|
||||
* \param fillValue
|
||||
*/
|
||||
explicit CMatrix3x1(double fillValue) : CMatrixBase(fillValue) {}
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Convert to vector
|
||||
* \return
|
||||
*/
|
||||
CVector3D toVector3D() const
|
||||
{
|
||||
return CVector3D(this->getElement(0, 0), this->getElement(1, 0), this->getElement(2, 0));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Convert from vector
|
||||
* \return
|
||||
*/
|
||||
void fromVector3D(const CVector3D &vector)
|
||||
{
|
||||
this->m_matrix(0, 0) = vector.i();
|
||||
this->m_matrix(1, 0) = vector.j();
|
||||
this->m_matrix(2, 0) = vector.k();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Math::CMatrix3x1)
|
||||
|
||||
Reference in New Issue
Block a user