16 #ifndef __F_MATRIX3_H__ 17 #define __F_MATRIX3_H__ 38 m11 = 1.0, m12 = 0.0, m13 = 0.0;
39 m21 = 0.0, m22 = 1.0, m23 = 0.0;
40 m31 = 0.0, m32 = 0.0, m33 = 1.0;
50 m11 = ini[0], m12 = ini[1], m13 = ini[2];
51 m21 = ini[3], m22 = ini[4], m23 = ini[5];
52 m31 = ini[6], m32 = ini[7], m33 = ini[8];
62 m11 = m22 = m33 = ini;
74 fMat33(
double _m11,
double _m12,
double _m13,
75 double _m21,
double _m22,
double _m23,
76 double _m31,
double _m32,
double _m33) {
77 m11 = _m11; m12 = _m12; m13 = _m13;
78 m21 = _m21; m22 = _m22; m23 = _m23;
79 m31 = _m31; m32 = _m32; m33 = _m33;
88 fMat33(
double d1,
double d2,
double d3) {
89 m11 = d1; m12 = 0.0; m13 = 0.0;
90 m21 = 0.0; m22 = d2; m23 = 0.0;
91 m31 = 0.0; m32 = 0.0; m33 = d3;
154 operator double *() {
167 void diag(
double,
double,
double);
170 void set(
const fMat33& mat);
175 void neg(
const fMat33& mat);
182 void div(
const fMat33& mat,
double d);
185 void rot2mat(
const fVec3&,
double);
186 void mat2rot(
fVec3&,
double&)
const;
189 void ea2mat_xyz(
const fVec3& ea);
190 void ea2mat_xzy(
const fVec3& ea);
191 void ea2mat_zyx(
const fVec3& ea);
192 void ea2mat_yzx(
const fVec3& ea);
238 fVec3(
double _m1,
double _m2,
double _m3) {
262 operator double *() {
297 return sqrt((*
this) * (*
this));
303 if(len >
TINY) ret = v / len;
310 if(len >
TINY) (*this) /= len;
319 void set(
double d1,
double d2,
double d3) {
325 void set(
const fVec3& vec);
330 void div(
const fVec3& vec,
double d);
331 void mul(
const fVec3& vec,
double d);
332 void mul(
double d,
const fVec3& vec);
341 void mat2ea_xyz(
const fMat33& mat);
342 void mat2ea_xyz(
const fMat33& mat,
const fVec3& ea_ref);
343 void mat2ea_xzy(
const fMat33& mat);
344 void mat2ea_zyx(
const fMat33& mat);
345 void mat2ea_yzx(
const fMat33& mat);
double operator[](int i) const
void operator/=(double d)
void operator-=(const fMat33 &mat)
double & operator()(int i, int j)
The reference to the (i, j)-th element.
friend fVec3 unit(const fVec3 &v)
Returns the unit vector with the same direction (with length check)
void operator*=(double d)
void div(const fMat33 &mat, double d)
void mul(fVec4 &_vec, double d)
fEulerPara operator*(double d, const fEulerPara &ep)
void zero()
Creates a zero vector.
void mul(const fMat33 &mat1, const fMat33 &mat2)
void operator/=(double d)
fVec3 epdot2angvel(const fEulerPara &_epara, const fEulerPara &_edot)
void add(const fVec4 &vec1, const fVec4 &vec2)
double * data()
Pointer to the first element.
fVec3 epddot2angacc(const fEulerPara &_e, const fEulerPara &_de, const fEulerPara &_dde)
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
png_bytep png_bytep png_size_t length
fVec3(double _m1, double _m2, double _m3)
double & operator()(int i)
Access the i-th element.
void operator*=(double d)
fMat33(double *ini)
Constructor with initial values as array.
fMat operator+(const fMat &mat1, const fMat &mat2)
void neg(const fMat33 &mat)
Functions for basic operations.
Generic matrix/vector classes.
void operator-=(const fVec3 &vec)
def j(str, encoding="cp932")
void unit()
Converts to unit vector.
double operator[](int i) const
Value of the i-th element in the array.
void operator=(double d)
Assignment operators.
void sub(const fVec4 &vec1, const fVec4 &vec2)
std::ostream & operator<<(std::ostream &ost, const Point &p)
fMat33(double ini)
Constructor with the same initial diagonal value.
void operator+=(const fMat33 &mat)
friend double dist(const fVec3 &p1, const fVec3 &p2)
Returns the distance between two points.
Vector3 cross(const Vector3 &v1, const Vector3 &v2)
fMat tran(const fMat &mat)
void sub(const fMat33 &mat1, const fMat33 &mat2)
fMat33()
Default constructor.
void sub(const fVec3 &vec1, const fVec3 &vec2)
fMat33(double d1, double d2, double d3)
Constructor with diagonal values.
fVec3 operator&(const fVec3 &vec1, const fVec3 &vec2)
friend double length(const fVec3 &v)
Returns the length of a vector.
void add(const fMat33 &mat1, const fMat33 &mat2)
fMat33 operator=(const fMat33 &mat)
Assignment operator.
fMat operator/(const fMat &mat, double d)
double * data()
Pointer to the first element.
void operator+=(const fVec3 &vec)
fMat33(double _m11, double _m12, double _m13, double _m21, double _m22, double _m23, double _m31, double _m32, double _m33)
Constructor with all values.
fEulerPara operator-(const fEulerPara &_ep)
fMat33(const fMat33 &ini)
Copy constructor.