16 template <
typename Real>
28 template <
typename Real>
33 template <
typename Real>
40 template <
typename Real>
51 template <
typename Real>
56 template <
typename Real>
60 Real m01 = v0[0] * v1[1] - v0[1] * v1[0];
61 Real m02 = v0[0] * v1[2] - v0[2] * v1[0];
62 Real m03 = v0[0] * v1[3] - v0[3] * v1[0];
63 Real m12 = v0[1] * v1[2] - v0[2] * v1[1];
64 Real m13 = v0[1] * v1[3] - v0[3] * v1[1];
65 Real m23 = v0[2] * v1[3] - v0[3] * v1[2];
68 +m23*v2[1] - m13*v2[2] + m12*v2[3],
69 -m23*v2[0] + m03*v2[2] - m02*v2[3],
70 +m13*v2[0] - m03*v2[1] + m01*v2[3],
71 -m12*v2[0] + m02*v2[1] - m01*v2[2]
75 template <
typename Real>
81 return unitHyperCross;
84 template <
typename Real>
91 template <
typename Real>
97 Real maxAbsValue = fabs(v[0][0]);
98 for (
int i = 1; i < 4; ++i)
100 Real absValue = fabs(v[0][i]);
101 if (absValue > maxAbsValue)
104 maxAbsValue = absValue;
115 else if (maxIndex == 3)
141 v[0][0] * v[1][1] - v[1][0] * v[0][1],
142 v[0][0] * v[1][2] - v[1][0] * v[0][2],
143 v[0][0] * v[1][3] - v[1][0] * v[0][3],
144 v[0][1] * v[1][2] - v[1][1] * v[0][2],
145 v[0][1] * v[1][3] - v[1][1] * v[0][3],
146 v[0][2] * v[1][3] - v[1][2] * v[0][3]
150 Real maxAbsValue = fabs(det[0]);
151 for (
int i = 1; i < 6; ++i)
153 Real absValue = fabs(det[i]);
154 if (absValue > maxAbsValue)
157 maxAbsValue = absValue;
163 v[2] = { -det[4], +det[2], (Real)0, -det[0] };
165 else if (maxIndex <= 2)
167 v[2] = { +det[5], (Real)0, -det[2], +det[1] };
171 v[2] = { (Real)0, -det[5], +det[4], -det[3] };
180 return Orthonormalize<4, Real>(4,
v, robust);
Vector4< Real > UnitHyperCross(Vector4< Real > const &v0, Vector4< Real > const &v1, Vector4< Real > const &v2, bool robust=false)
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
GLfloat GLfloat GLfloat GLfloat v3
Real Normalize(GVector< Real > &v, bool robust=false)
GLfloat GLfloat GLfloat v2
Real ComputeOrthogonalComplement(int numInputs, Vector2< Real > *v, bool robust=false)
Real DotHyperCross(Vector4< Real > const &v0, Vector4< Real > const &v1, Vector4< Real > const &v2, Vector4< Real > const &v3)
Vector4< Real > HyperCross(Vector4< Real > const &v0, Vector4< Real > const &v1, Vector4< Real > const &v2)