Go to the documentation of this file. 1 #ifndef GEOLIB_MATRIX_H_
2 #define GEOLIB_MATRIX_H_
28 memcpy(
v_, v, 3 *
sizeof(
real));
31 inline const real&
x()
const {
return v_[0]; }
32 inline const real&
y()
const {
return v_[1]; }
33 inline const real&
z()
const {
return v_[2]; }
53 v_[0] /= l;
v_[1] /= l;
v_[2] /= l;
77 out <<
"[ " << v.
v_[0] <<
" " << v.
v_[1] <<
" " << v.
v_[2] <<
" ]";
121 memcpy(
m_, m, 9 *
sizeof(
real));
126 real cj = cos(pitch);
129 real sj = sin(pitch);
136 m_[0] = cj * ch;
m_[1] = sj * sc - cs;
m_[2] = sj * cc + ss;
137 m_[3] = cj * sh;
m_[4] = sj * ss + cc,
m_[5] = sj * cs - sc;
138 m_[6] = -sj;
m_[7] = cj * si;
m_[8] = cj * ci ;
158 out <<
"[ " << m.
m_[0] <<
" " << m.
m_[1] <<
" " << m.
m_[2] <<
std::endl
160 << m.
m_[6] <<
" " << m.
m_[7] <<
" " << m.
m_[8] <<
" ]";
177 o_[0] = x;
o_[1] = y;
o_[2] = z;
186 r_[0] = m11;
r_[1] = m12;
r_[2] = m13;
187 r_[3] = m21;
r_[4] = m22;
r_[5] = m23;
188 r_[6] = m31;
r_[7] = m32;
r_[8] = m33;
189 o_[0] = x;
o_[1] = y;
o_[2] = z;
233 real cj = cos(pitch);
236 real sj = sin(pitch);
243 r_[0] = cj * ch;
r_[1] = sj * sc - cs;
r_[2] = sj * cc + ss;
244 r_[3] = cj * sh;
r_[4] = sj * ss + cc,
r_[5] = sj * cs - sc;
245 r_[6] = -sj;
r_[7] = cj * si;
r_[8] = cj * ci ;
249 out <<
"[ " <<
t.r_[0] <<
" " <<
t.r_[1] <<
" " <<
t.r_[2] <<
" [ " <<
t.o_[0] <<
" ]" <<
std::endl
250 <<
t.r_[3] <<
" " <<
t.r_[4] <<
" " <<
t.r_[5] <<
" [ " <<
t.o_[1] <<
" ]" <<
std::endl
251 <<
t.r_[6] <<
" " <<
t.r_[7] <<
" " <<
t.r_[8] <<
" ] [ " <<
t.o_[2] <<
" ]";
Vector3 operator*(const Vector3 &v) const
Vector3 operator*(real f) const
friend std::ostream & operator<<(std::ostream &out, const Matrix3x3 &m)
const real & getY() const
const real & getZ() const
void setRPY(real roll, real pitch, real yaw)
friend Vector3 operator-(const Vector3 &v)
real dot(const Vector3 &v) const
Vector3 operator/(real f) const
Vector3(real x, real y, real z)
Vector3 operator-(const Vector3 &v) const
Matrix3x3 operator*(const Matrix3x3 &n) const
Vector3 operator+(const Vector3 &v) const
Matrix3x3(real m11, real m12, real m13, real m21, real m22, real m23, real m31, real m32, real m33)
friend Vector3 operator*(real s, const Vector3 &v)
friend std::ostream & operator<<(std::ostream &out, const Vector3 &v)
const real & getX() const