36 const char*
const triad::Vector<vector>::typeName =
"triad";
39 const char* triad::Vector<vector>::componentNames[] = {
"x",
"y",
"z"};
57 vector(VGREAT, VGREAT, VGREAT),
58 vector(VGREAT, VGREAT, VGREAT),
59 vector(VGREAT, VGREAT, VGREAT)
64 vector(-VGREAT, -VGREAT, -VGREAT),
65 vector(-VGREAT, -VGREAT, -VGREAT),
66 vector(-VGREAT, -VGREAT, -VGREAT)
71 vector(ROOTVGREAT, ROOTVGREAT, ROOTVGREAT),
72 vector(ROOTVGREAT, ROOTVGREAT, ROOTVGREAT),
73 vector(ROOTVGREAT, ROOTVGREAT, ROOTVGREAT)
78 vector(-ROOTVGREAT, -ROOTVGREAT, -ROOTVGREAT),
79 vector(-ROOTVGREAT, -ROOTVGREAT, -ROOTVGREAT),
80 vector(-ROOTVGREAT, -ROOTVGREAT, -ROOTVGREAT)
92 vector(VGREAT, VGREAT, VGREAT),
93 vector(VGREAT, VGREAT, VGREAT),
94 vector(VGREAT, VGREAT, VGREAT)
130 if (set(0) && set(1) && !set(2))
132 operator[](2) = orthogonal(
operator[](0),
operator[](1));
134 else if (set(0) && set(2) && !set(1))
136 operator[](1) = orthogonal(
operator[](0),
operator[](2));
138 else if (set(1) && set(2) && !set(0))
140 operator[](0) = orthogonal(
operator[](1),
operator[](2));
146 for (
int i=0; i<2; i++)
148 scalar o01 =
mag(
operator[](0) &
operator[](1));
149 scalar o02 =
mag(
operator[](0) &
operator[](2));
150 scalar o12 =
mag(
operator[](1) &
operator[](2));
152 if (o01 < o02 && o01 < o12)
154 operator[](2) = orthogonal(
operator[](0),
operator[](1));
167 operator[](1) = orthogonal(
operator[](0),
operator[](2));
180 operator[](0) = orthogonal(
operator[](1),
operator[](2));
202 if (t2.
set(i) && !set(i))
204 operator[](i) = t2.operator[](i);
213 if (set() && t2.
set())
226 scalar mostAligned = -1;
232 if (correspondance[
k] == j)
241 scalar a = operator[](i) & t2.operator[](j);
242 scalar maga =
mag(a);
244 if (maga > mostAligned)
246 correspondance[i] = j;
253 operator[](i) += signd[i]*t2.operator[](correspondance[i]);
265 mag(v &
operator[](0)),
266 mag(v &
operator[](1)),
267 mag(v &
operator[](2))
274 mostAligned.
x() > mostAligned.
y()
275 && mostAligned.
x() > mostAligned.
z()
278 mav = mostAligned.
x();
279 mostAligned = operator[](0);
281 else if (mostAligned.
y() > mostAligned.
z())
283 mav = mostAligned.
y();
284 mostAligned = operator[](1);
288 mav = mostAligned.
z();
289 mostAligned = operator[](2);
315 mag(
operator[](0).
x()) >
mag(
operator[](1).
x())
316 &&
mag(
operator[](0).
x()) >
mag(
operator[](2).
x())
319 t[0] = operator[](0);
321 if (
mag(
operator[](1).
y()) >
mag(
operator[](2).
y()))
323 t[1] = operator[](1);
324 t[2] = operator[](2);
328 t[1] = operator[](2);
329 t[2] = operator[](1);
334 mag(
operator[](1).
x()) >
mag(
operator[](2).
x())
337 t[0] = operator[](1);
339 if (
mag(
operator[](0).
y()) >
mag(
operator[](2).
y()))
341 t[1] = operator[](0);
342 t[2] = operator[](2);
346 t[1] = operator[](2);
347 t[2] = operator[](0);
352 t[0] = operator[](2);
354 if (
mag(
operator[](0).
y()) >
mag(
operator[](1).
y()))
356 t[1] = operator[](0);
357 t[2] = operator[](1);
361 t[1] = operator[](1);
362 t[2] = operator[](0);
366 if (t[0].
x() < 0) t[0] *= -1;
367 if (t[1].
y() < 0) t[1] *= -1;
368 if (t[2].z() < 0) t[2] *= -1;
412 scalar sumDifference = 0;
416 if (!tmpA.
set(dir) || !tmpB.
set(dir))
422 (tmpA[dir] & tmpB[dir])
423 /(
mag(tmpA[dir])*
mag(tmpA[dir]) + SMALL);
430 return (sumDifference/3);