27 #if defined(HAVE_CONFIG_H)
30 #if defined(HAVE_GL_GL_H)
32 #elif defined(HAVE_OPENGL_GL_H)
33 #include <OpenGL/gl.h>
51 j = (i + 100 * n) % n;
66 det = a[0][0] * (a[1][1] * a[2][2] - a[1][2] * a[2][1])
67 + a[0][1] * (a[1][2] * a[2][0] - a[1][0] * a[2][2])
68 + a[0][2] * (a[1][0] * a[2][1] - a[1][1] * a[2][0]);
70 c[0] = b[0] * (a[1][1] * a[2][2] - a[1][2] * a[2][1])
71 + b[1] * (a[0][2] * a[2][1] - a[0][1] * a[2][2])
72 + b[2] * (a[0][1] * a[1][2] - a[0][2] * a[1][1]);
74 c[1] = b[0] * (a[1][2] * a[2][0] - a[1][0] * a[2][2])
75 + b[1] * (a[0][0] * a[2][2] - a[0][2] * a[2][0])
76 + b[2] * (a[0][2] * a[1][0] - a[0][0] * a[1][2]);
78 c[2] = b[0] * (a[1][0] * a[2][1] - a[1][1] * a[2][0])
79 + b[1] * (a[0][1] * a[2][0] - a[0][0] * a[2][1])
80 + b[2] * (a[0][0] * a[1][1] - a[0][1] * a[1][0]);
82 for (i = 0; i<3; ++i) b[i] = c[i] / det;
96 for (i = 0; i < n; ++i) swap[i] = i;
98 for (i = 0; i < n - 1; ++i) {
99 for (j = i + 1; j < n; ++j) {
100 if (key[swap[j]] < key[swap[i]]) {
123 out[0] = in1[1] * in2[2] - in1[2] * in2[1]
124 + in2[1] * in3[2] - in2[2] * in3[1]
125 + in3[1] * in1[2] - in3[2] * in1[1];
126 out[1] = in1[2] * in2[0] - in1[0] * in2[2]
127 + in2[2] * in3[0] - in2[0] * in3[2]
128 + in3[2] * in1[0] - in3[0] * in1[2];
129 out[2] = in1[0] * in2[1] - in1[1] * in2[0]
130 + in2[0] * in3[1] - in2[1] * in3[0]
131 + in3[0] * in1[1] - in3[1] * in1[0];
132 norm = sqrtf(out[0] * out[0] + out[1] * out[1] + out[2] * out[2]);
133 for (i = 0; i<3; i++) out[i] = out[i] / norm;
142 ithread = omp_get_thread_num();