22 #ifndef VERDICT_DEFINES
23 #define VERDICT_DEFINES
35 #define VERDICT_MIN( a, b ) ( ( a ) < ( b ) ? ( a ) : ( b ) )
36 #define VERDICT_MAX( a, b ) ( ( a ) > ( b ) ? ( a ) : ( b ) )
38 inline double determinant(
double a,
double b,
double c,
double d )
40 return ( ( a ) * ( d ) - ( b ) * ( c ) );
45 return v1 % ( v2 * v3 );
48 #define jacobian_matrix( a, b, c, d, e, f, g ) \
50 jac_mat_tmp = sqrt( a ); \
51 if( jac_mat_tmp == 0 ) \
60 ( d ) = jac_mat_tmp; \
62 ( f ) = ( b ) / jac_mat_tmp; \
63 ( g ) = ( c ) / jac_mat_tmp; \
67 #define form_t( m11, m21, m12, m22, mw11, mw21, mw12, mw22, detmw, xm11, xm21, xm12, xm22 ) \
68 xm11 = ( ( m11 ) * ( mw22 ) - ( m12 ) * ( mw21 ) ) / ( detmw ); \
69 ( xm21 ) = ( ( m21 ) * ( mw22 ) - ( m22 ) * ( mw21 ) ) / ( detmw ); \
70 ( xm12 ) = ( ( m12 ) * ( mw11 ) - ( m11 ) * ( mw12 ) ) / ( detmw ); \
71 ( xm22 ) = ( ( m22 ) * ( mw11 ) - ( m21 ) * ( mw12 ) ) / ( detmw );
81 double return_value = 0.0;
86 double l1, l2, l3, length_product;
94 length_product = sqrt( l1 * l2 * l3 );
98 if( length_product < fabs( jacobi ) )
100 length_product = fabs( jacobi );
106 return_value = jacobi / length_product;
111 inline double norm_squared(
double m11,
double m21,
double m12,
double m22 )
113 return m11 * m11 + m21 * m21 + m12 * m12 + m22 * m22;
116 #define metric_matrix( m11, m21, m12, m22, gm11, gm12, gm22 ) \
117 gm11 = ( m11 ) * ( m11 ) + ( m21 ) * ( m21 ); \
118 ( gm12 ) = ( m11 ) * ( m12 ) + ( m21 ) * ( m22 ); \
119 ( gm22 ) = ( m12 ) * ( m12 ) + ( m22 ) * ( m22 );
130 double tmp = sqrt( gm11 * gm22 );
153 rx1.
set( x1.
x(), x2.
x(), x3.
x() );
154 rx2.
set( x1.
y(), x2.
y(), x3.
y() );
155 rx3.
set( x1.
z(), x2.
z(), x3.
z() );
218 double g11, g12, g13, g22, g23, g33;
227 double rtg11 = sqrt( g11 );
228 double rtg22 = sqrt( g22 );
229 double rtg33 = sqrt( g33 );
234 double cross = sqrt( temp1 % temp1 );
236 double q11, q21, q31;
237 double q12, q22, q32;
238 double q13, q23, q33;
244 q12 = g12 / rtg11 / rtg22;
245 q22 =
cross / rtg11 / rtg22;
248 q13 = g13 / rtg11 / rtg33;
249 q23 = ( g11 * g23 - g12 * g13 ) / rtg11 / rtg33 /
cross;
251 q33 = ( v1 % temp1 ) / rtg33 /
cross;
253 q1.
set( q11, q21, q31 );
254 q2.
set( q12, q22, q32 );
255 q3.
set( q13, q23, q33 );
271 x1.
set( a1.
x(), a2.
x(), a3.
x() );
272 x2.
set( a1.
y(), a2.
y(), a3.
y() );
273 x3.
set( a1.
z(), a2.
z(), a3.
z() );
275 c1.
set( x1 % b1, x2 % b1, x3 % b1 );
276 c2.
set( x1 % b2, x2 % b2, x3 % b2 );
277 c3.
set( x1 % b3, x2 % b3, x3 % b3 );
283 return ( x1 % x1 ) + ( x2 % x2 ) + ( x3 % x3 );
293 double normsq1, normsq2, kappa;
297 inverse( qw1, qw2, qw3, u1, u2, u3 );
298 product( q1, q2, q3, u1, u2, u3, x1, x2, x3 );
299 inverse( x1, x2, x3, u1, u2, u3 );
302 kappa = sqrt( normsq1 * normsq2 );