98 lines
2.6 KiB
Plaintext
98 lines
2.6 KiB
Plaintext
//
|
|
// ********************************************************************
|
|
// * DISCLAIMER *
|
|
// * *
|
|
// * The following disclaimer summarizes all the specific disclaimers *
|
|
// * of contributors to this software. The specific disclaimers,which *
|
|
// * govern, are listed with their locations in: *
|
|
// * http://cern.ch/geant4/license *
|
|
// * *
|
|
// * Neither the authors of this software system, nor their employing *
|
|
// * institutes,nor the agencies providing financial support for this *
|
|
// * work make any representation or warranty, express or implied, *
|
|
// * regarding this software system or assume any liability for its *
|
|
// * use. *
|
|
// * *
|
|
// * This code implementation is the intellectual property of the *
|
|
// * GEANT4 collaboration. *
|
|
// * By copying, distributing or modifying the Program (or any work *
|
|
// * based on the Program) you indicate your acceptance of this *
|
|
// * statement, and all its terms. *
|
|
// ********************************************************************
|
|
//
|
|
//
|
|
// $Id: G4Ray.icc,v 1.6 2002/11/21 16:52:53 gcosmo Exp $
|
|
// GEANT4 tag $Name: geant4-05-00 $
|
|
//
|
|
// --------------------------------------------------------------------
|
|
// GEANT 4 inline definitions file
|
|
//
|
|
// G4Ray.icc
|
|
//
|
|
// Implementation of inline methods of G4Ray
|
|
// --------------------------------------------------------------------
|
|
|
|
inline
|
|
G4Point3D G4Ray::GetPoint(G4double i) const
|
|
{
|
|
return G4Point3D( start+i*dir );
|
|
}
|
|
|
|
inline
|
|
G4double G4Ray::GetPPoint(const G4Point3D& p) const
|
|
{
|
|
// |dir|==1
|
|
return (p-start)*dir;
|
|
}
|
|
|
|
inline
|
|
const G4Vector3D& G4Ray::GetDir() const
|
|
{
|
|
return dir;
|
|
}
|
|
|
|
inline
|
|
const G4Point3D& G4Ray::GetStart() const
|
|
{
|
|
return start;
|
|
}
|
|
|
|
inline
|
|
void G4Ray::SetDir(const G4Vector3D& dir0)
|
|
{
|
|
dir= dir0.unit();
|
|
}
|
|
|
|
inline
|
|
void G4Ray::SetStart(const G4Point3D& start0)
|
|
{
|
|
start= start0;
|
|
}
|
|
|
|
inline
|
|
void G4Ray::Init(const G4Point3D& start0, const G4Vector3D& dir0)
|
|
{
|
|
start= start0;
|
|
dir= dir0;
|
|
RayCheck();
|
|
CreatePlanes();
|
|
}
|
|
|
|
inline
|
|
G4double G4Ray::P2(G4double x) const
|
|
{
|
|
return(x*x);
|
|
}
|
|
|
|
inline
|
|
G4int G4Ray::NearZero(G4double val, G4double epsilon) const
|
|
{
|
|
return ( ((val) > -epsilon) && ((val) < epsilon) );
|
|
}
|
|
|
|
inline
|
|
void G4Ray::Vsetall(G4Vector3D &a, G4double s)
|
|
{
|
|
a.setX(s); a.setY(s); a.setZ(s);
|
|
}
|