38 fABdistanceSq = VecAtoB.
mag2() ;
57 G4double sq_VecAZ, inner_prod, unit_projection ;
59 VecAZ= OtherPnt - EndpointA;
60 sq_VecAZ = VecAZ.
mag2();
62 inner_prod= VecAtoB.
dot( VecAZ );
66 if( fABdistanceSq != 0.0 )
69 unit_projection = inner_prod/fABdistanceSq;
71 if( (0. <= unit_projection ) && (unit_projection <= 1.0 ) )
73 dist_sq= sq_VecAZ - unit_projection * inner_prod ;
80 if( unit_projection < 0. )
88 dist_sq = VecBZ.
mag2();
94 dist_sq = (OtherPnt - EndpointA).mag2() ;
96 if( dist_sq < 0.0 ) dist_sq = 0.0 ;
98 return std::sqrt(dist_sq) ;
107 return LineAB.
Dist( OtherPnt );
G4double Dist(G4ThreeVector OtherPnt) const
double dot(const Hep3Vector &) const
static G4double Distline(const G4ThreeVector &OtherPnt, const G4ThreeVector &LinePntA, const G4ThreeVector &LinePntB)
G4LineSection(const G4ThreeVector &PntA, const G4ThreeVector &PntB)