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]));