154{
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174 G4int which_way = -1;
175
177
178 G4Vector3D lv ( kInfinity, kInfinity, kInfinity );
180
181
182
185
186
187
188
192 maxsoln = 2;
193
194
195
197 sol[0] = -1.0;
198 sol[1] = -1.0 ;
199
200
201
207 G4double B = 2.0 * ( gamma * dhat - T * ga * da );
208 G4double C = gamma * gamma - T * ga * ga;
209
210
211
213 {
214 if ( B == 0.0 )
215 { return 1; }
216 else
217 { sol[0] = -C / B; }
218 }
219
220
221
222 else
223 {
224 G4double radical = B * B - 4.0 * A * C;
225 if ( radical < 0.0 )
226 {
227 return 1;
228 }
229 else
230 {
231 G4double root = std::sqrt( radical );
232 sol[0] = ( - B + root ) / ( 2. * A );
233 sol[1] = ( - B - root ) / ( 2. * A );
234 }
235 }
236
237
238
240
241
242
243
244
245
246 for ( isoln = 0; isoln < maxsoln; isoln++ )
247 {
248 if ( sol[isoln] >= 0.0 )
249 {
250 if ( sol[isoln] >= kInfinity )
251 {
252 return 1;
253 }
254
257
258
259
263 {
264 return 1;
265 }
266 }
267 }
268
269
270
271
274
275 return 0;
276}
void sort_double(G4double[], G4int, G4int)
virtual G4Vector3D SurfaceNormal(const G4Point3D &p) const
G4Vector3D GetAxis() const
G4double GetAngle() const
G4Point3D GetPoint(G4double i) const
const G4Vector3D & GetDir() const
const G4Point3D & GetStart() const
G4Vector3D GetOrigin() const