static void points2plane(const GLfloat*__restrict__ A, const GLfloat*__restrict__ B, const GLfloat*__restrict__ C, GLfloat*__restrict__ out) { #define x1 A[0] #define x2 B[0] #define x3 C[0] #define y1 A[1] #define y2 B[1] #define y3 C[1] #define z1 A[2] #define z2 B[2] #define z3 C[2] out[0] = y1 * (z2 - z3) + y2 * (z3 - z1) + y3 * (z1 - z2); out[1] = z1 * (x2 - x3) + z2 * (x3 - x1) + z3 * (x1 - x2); out[2] = x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2); out[3] = -(x1 * (y2 * z3 - y3 * z2) + x2 * (y3 * z1 - y1 * z3) + x3 * (y1 * z2 - y2 * z1)); #undef x1 #undef x2 #undef x3 #undef y1 #undef y2 #undef y3 #undef z1 #undef z2 #undef z3 }