23 #define VERDICT_EXPORTS
30 #if defined( __BORLANDC__ )
38 double len = this->
length();
39 xVal *= new_length / len;
40 yVal *= new_length / len;
41 zVal *= new_length / len;
47 double xv =
xVal - test_vector.
x();
48 double yv =
yVal - test_vector.
y();
49 double zv =
zVal - test_vector.
z();
51 return ( sqrt( xv * xv + yv * yv + zv * zv ) );
66 double cosAngle = 0., angleRad = 0., len1, len2 = 0.;
68 if( ( ( len1 = this->
length() ) > 0 ) && ( ( len2 = otherVector.
length() ) > 0 ) )
69 cosAngle = ( *
this % otherVector ) / ( len1 * len2 );
76 if( ( cosAngle > 1.0 ) && ( cosAngle < 1.0001 ) )
79 angleRad = acos( cosAngle );
81 else if( cosAngle < -1.0 && cosAngle > -1.0001 )
84 angleRad = acos( cosAngle );
86 else if( cosAngle >= -1.0 && cosAngle <= 1.0 )
87 angleRad = acos( cosAngle );
90 assert( cosAngle < 1.0001 && cosAngle > -1.0001 );
109 double theta_ = atan2(
y(),
x() );
119 double x_ =
r() * cos(
theta() );
120 double y_ =
r() * sin(
theta() );
141 assert( gamma > 0.0 );
143 if(
r() > rmin * 1.001 &&
r() < 1.001 )
145 r() = rmin + pow(
r(), gamma ) * ( 1.0 - rmin );
157 const double r_factor = 0.3;
158 const double theta_factor = 0.6;
174 r( ( r_factor +
r() ) / ( 1 + r_factor ) );
182 double new_theta =
theta() * gamma;
210 double xv = vec2 % rx;
211 double yv = vec2 % ry;
214 assert( xv != 0.0 || yv != 0.0 );
216 angle = atan2( yv, xv );
268 double len_tol = 0.0000001;
269 if( normal_lensq <= len_tol )
274 normal = vector1 * vector2;
276 if( normal_lensq <= len_tol )
278 double cosine = vector1 % vector2;
288 double dot_tol = 0.985;
289 double dot = vector1 % normal;
292 normal = vector1 * vector2;
296 if( normal_lensq <= len_tol )
298 double cosine = vector1 % vector2;
308 dot = vector2 % normal;
311 normal = vector1 * vector2;
324 double yv = vector2 % yAxis;
327 double xv = vector2 % yAxis;
330 if( xv == 0.0 && yv == 0.0 )
334 double angle = atan2( yv, xv );
345 if( ( fabs( this->
x() - vectorPtr2.
x() ) <
tolerance ) && ( fabs( this->
y() - vectorPtr2.
y() ) <
tolerance ) &&
346 ( fabs( this->
z() - vectorPtr2.
z() ) <
tolerance ) )
357 unsigned short i = 0;
358 unsigned short imin = 0;
359 double rmin = 1.0E20;
360 unsigned short iperm1[3];
361 unsigned short iperm2[3];
362 unsigned short cont_flag = 1;
363 double vec1[3], vec2[3];
381 while( i < 3 && cont_flag )
383 if( fabs( vec1[i] ) < 1e-6 )
386 vec2[iperm1[i]] = 0.0;
387 vec2[iperm2[i]] = 0.0;
391 if( fabs( vec1[i] ) < rmin )
394 rmin = fabs( vec1[i] );
402 xv[iperm1[imin]] = 0.0;
403 xv[iperm2[imin]] = 0.0;
406 vec2[0] = vec1[1] * xv[2] - vec1[2] * xv[1];
407 vec2[1] = vec1[2] * xv[0] - vec1[0] * xv[2];
408 vec2[2] = vec1[0] * xv[1] - vec1[1] * xv[0];
411 rmag = sqrt( vec2[0] * vec2[0] + vec2[1] * vec2[1] + vec2[2] * vec2[2] );
421 vector3 = vector1 * vector2;
431 out_point.
x(
xVal + ( distance * my_direction.
x() ) );
432 out_point.
y(
yVal + ( distance * my_direction.
y() ) );
433 out_point.
z(
zVal + ( distance * my_direction.
z() ) );