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]);
70 : zLo(0.), zHi(0.), rLo(0.), rHi(0.),
A(0.),
B(0.)
94 if (z < zLo || z >
zHi)
return false;
98 if (r < rLo || r >
rHi)
return false;
216 if (radical < -
EPS*std::fabs(b)) {
return 0; }
218 if (radical <
EPS*std::fabs(b))
225 if(
B==0.) {
return 0; }
226 if ( std::fabs(x0*ty - y0*tx) < std::fabs(
EPS/
B) )
236 radical = std::sqrt(radical);
241 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
244 if (sa < sb) { *s1 = sa; *s2 = sb; }
else { *s1 = sb; *s2 = sa; }
245 if (
A +
B*(
z0+(*s1)*tz) < 0) {
return 0; }
250 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
253 *s1 = (
B*tz > 0)^(sa > sb) ? sb : sa;
263 if (
A +
B*(
z0+(*s1)*tz) < 0) {
return 0; }
304 if (std::fabs(tz) < 1/
kInfinity) {
return 0; }
338 if (radical < -
EPS*std::fabs(b)) {
return 0; }
340 if (radical <
EPS*std::fabs(b))
347 if ( std::fabs(x0*ty - y0*tx) < std::fabs(
EPS/
B) )
357 radical = std::sqrt(radical);
362 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
365 if (sa < sb) { *s1 = sa; *s2 = sb; }
else { *s1 = sb; *s2 = sa; }
366 if ((
z0 + (*s1)*tz -
A)/
B < 0) {
return 0; }
371 G4double sa, sb, q = -0.5*( b + (b < 0 ? -radical : +radical) );
374 *s1 = (tz*
B > 0)^(sa > sb) ? sb : sa;
384 if ((
z0 + (*s1)*tz -
A)/
B < 0) {
return 0; }
G4double B(G4double temperature)
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
G4bool HitOn(const G4double r, const G4double z)
virtual ~G4IntersectingCone()
G4int LineHitsCone(const G4ThreeVector &p, const G4ThreeVector &v, G4double *s1, G4double *s2)
G4int LineHitsCone1(const G4ThreeVector &p, const G4ThreeVector &v, G4double *s1, G4double *s2)
G4IntersectingCone(const G4double r[2], const G4double z[2])
G4int LineHitsCone2(const G4ThreeVector &p, const G4ThreeVector &v, G4double *s1, G4double *s2)
static const G4double kInfinity
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments