45 type1 = (std::abs(z[1]-z[0]) > std::abs(r[1]-r[0]));
49 B = (r[1] - r[0]) / (z[1] - z[0]);
50 A = (r[0]*z[1] - r[1]*z[0]) / (z[1] -z[0]);
54 B = (z[1] - z[0]) / (r[1] - r[0]);
55 A = (z[0]*r[1] - z[1]*r[0]) / (r[1] - r[0]);
60 rLo = std::min(r[0], r[1]) - halfCarTolerance;
61 rHi = std::max(r[0], r[1]) + halfCarTolerance;
62 zLo = std::min(z[0], z[1]) - halfCarTolerance;
63 zHi = std::max(z[0], z[1]) + halfCarTolerance;
207 G4double radical = (br*br - 4*ar*cr) + ((std::max(arcz,azcr) - 2*bz*br) + std::min(arcz,azcr));
214 if (radical < -
EPS*std::fabs(b)) {
return 0; }
216 if (radical <
EPS*std::fabs(b))
221 if (std::fabs(a) > 1/kInfinity)
223 if(
B==0.) {
return 0; }
224 if ( std::fabs(x0*ty - y0*tx) < std::fabs(
EPS/
B) )
234 radical = std::sqrt(radical);
239 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
242 if (sa < sb) { *s1 = sa; *s2 = sb; }
else { *s1 = sb; *s2 = sa; }
243 if (
A +
B*(z0+(*s1)*tz) < 0) {
return 0; }
246 else if (a < -1/kInfinity)
248 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
251 *s1 = (
B*tz > 0)^(sa > sb) ? sb : sa;
254 else if (std::fabs(b) < 1/kInfinity)
261 if (
A +
B*(z0+(*s1)*tz) < 0) {
return 0; }
302 if (std::fabs(tz) < 1/kInfinity) {
return 0; }
329 G4double radical = (br*br - 4*ar*cr) + ((std::max(arcz,azcr) - 2*bz*br) + std::min(arcz,azcr));
336 if (radical < -
EPS*std::fabs(b)) {
return 0; }
338 if (radical <
EPS*std::fabs(b))
343 if (std::fabs(a) > 1/kInfinity)
345 if ( std::fabs(x0*ty - y0*tx) < std::fabs(
EPS/
B) )
355 radical = std::sqrt(radical);
358 if (a < -1/kInfinity)
360 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
363 if (sa < sb) { *s1 = sa; *s2 = sb; }
else { *s1 = sb; *s2 = sa; }
364 if ((z0 + (*s1)*tz -
A)/
B < 0) {
return 0; }
367 else if (a > 1/kInfinity)
369 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
372 *s1 = (tz*
B > 0)^(sa > sb) ? sb : sa;
375 else if (std::fabs(b) < 1/kInfinity)
382 if ((z0 + (*s1)*tz -
A)/
B < 0) {
return 0; }