19 #ifndef GEOM_VECMAT4_OP_HH
20 #define GEOM_VECMAT4_OP_HH
36 return v[0]*v[0]+v[1]*v[1]+v[2]*v[2]+v[3]*v[3];
48 return std::fabs(v1[0]-v2[0])<epsilon &&
49 std::fabs(v1[1]-v2[1])<epsilon &&
50 std::fabs(v1[2]-v2[2])<epsilon &&
51 std::fabs(v1[3]-v2[3])<epsilon;
57 return std::fabs(m1(0,0)-m2(0,0))<epsilon &&
58 std::fabs(m1(0,1)-m2(0,1))<epsilon &&
59 std::fabs(m1(0,2)-m2(0,2))<epsilon &&
60 std::fabs(m1(0,3)-m2(0,3))<epsilon &&
61 std::fabs(m1(1,0)-m2(1,0))<epsilon &&
62 std::fabs(m1(1,1)-m2(1,1))<epsilon &&
63 std::fabs(m1(1,2)-m2(1,2))<epsilon &&
64 std::fabs(m1(1,3)-m2(1,3))<epsilon &&
65 std::fabs(m1(2,0)-m2(2,0))<epsilon &&
66 std::fabs(m1(2,1)-m2(2,1))<epsilon &&
67 std::fabs(m1(2,2)-m2(2,2))<epsilon &&
68 std::fabs(m1(2,3)-m2(2,3))<epsilon &&
69 std::fabs(m1(3,0)-m2(3,0))<epsilon &&
70 std::fabs(m1(3,1)-m2(3,1))<epsilon &&
71 std::fabs(m1(3,2)-m2(3,2))<epsilon &&
72 std::fabs(m1(3,3)-m2(3,3))<epsilon;
78 return v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]+v1[3]*v2[3];
93 Vec4 nrvo(v1[0]*v2[0],v1[1]*v2[1],v1[2]*v2[2],v1[3]*v2[3]);
100 Vec4 nrvo(v1[0]/v2[0],v1[1]/v2[1],v1[2]/v2[2],v1[3]/v2[3]);
107 Vec4 nrvo(v[0]*m(0,0)+v[1]*m(1,0)+v[2]*m(2,0)+v[3]*m(3,0),
108 v[0]*m(0,1)+v[1]*m(1,1)+v[2]*m(2,1)+v[3]*m(3,1),
109 v[0]*m(0,2)+v[1]*m(1,2)+v[2]*m(2,2)+v[3]*m(3,2),
110 v[0]*m(0,3)+v[1]*m(1,3)+v[2]*m(2,3)+v[3]*m(3,3));
117 Vec4 nrvo(v[0]*m(0,0)+v[1]*m(0,1)+v[2]*m(0,2)+v[3]*m(0,3),
118 v[0]*m(1,0)+v[1]*m(1,1)+v[2]*m(1,2)+v[3]*m(1,3),
119 v[0]*m(2,0)+v[1]*m(2,1)+v[2]*m(2,2)+v[3]*m(2,3),
120 v[0]*m(3,0)+v[1]*m(3,1)+v[2]*m(3,2)+v[3]*m(3,3));
139 Vec4 nrvo(std::min(v1[0],v2[0]),
140 std::min(v1[1],v2[1]),
141 std::min(v1[2],v2[2]),
142 std::min(v1[3],v2[3]));
149 Vec4 nrvo(std::max(v1[0],v2[0]),
150 std::max(v1[1],v2[1]),
151 std::max(v1[2],v2[2]),
152 std::max(v1[3],v2[3]));
#define DLLEXPORT_OST_GEOM
Vec2 CompDivide(const Vec2 &v1, const Vec2 &v2)
divide each component of v1 by that of v2
Real DLLEXPORT_OST_GEOM Angle(const Line2 &l1, const Line2 &l2)
Vec2 Min(const Vec2 &v1, const Vec2 &v2)
Vec2 CompMultiply(const Vec2 &v1, const Vec2 &v2)
multiply each component of v1 with that of v2
Vec2 Max(const Vec2 &v1, const Vec2 &v2)
Quat DLLEXPORT_OST_GEOM Normalize(const Quat &q)
Real DLLEXPORT_OST_GEOM Dot(const Quat &q0, const Quat &q1)
Real DLLEXPORT_OST_GEOM Minor(const Mat3 &m, unsigned int i, unsigned int j)
Real Length(const Vec2 &v)
returns length of vector
Real Length2(const Vec2 &v)
returns squared length of vector
static const Real EPSILON
bool DLLEXPORT_OST_GEOM Equal(const Line2 &l1, const Line2 &l2, Real ephilon=EPSILON)
Vec2 operator*(const Vec2 &v, const Mat2 &m)
vector matrix multiplication
Mat2 DLLEXPORT_OST_GEOM Transpose(const Mat2 &m)
Transpose.
Real DLLEXPORT_OST_GEOM Comp(const Mat3 &m, unsigned int i, unsigned int j)
Mat2 DLLEXPORT_OST_GEOM Invert(const Mat2 &m)
Matrix inversion.
Real DLLEXPORT_OST_GEOM Det(const Mat2 &m)
determinant