|
||||
File indexing completed on 2025-01-18 09:58:37
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 // G4LineSection 0027 // 0028 // Class description: 0029 // 0030 // A utility class that calculates the distance of a point from a 0031 // line section. 0032 0033 // Created: J.Apostolakis, 1999 0034 // -------------------------------------------------------------------- 0035 0036 #ifndef G4LineSection_hh 0037 #define G4LineSection_hh 0038 0039 #include "G4Types.hh" 0040 #include "G4ThreeVector.hh" 0041 0042 class G4LineSection 0043 { 0044 public: // with description 0045 0046 G4LineSection( const G4ThreeVector& PntA, 0047 const G4ThreeVector& PntB ); 0048 0049 G4double Dist( const G4ThreeVector& OtherPnt ) const; 0050 0051 inline G4double GetABdistanceSq() const; 0052 0053 inline static G4double Distline( const G4ThreeVector& OtherPnt, 0054 const G4ThreeVector& LinePntA, 0055 const G4ThreeVector& LinePntB ); 0056 private: 0057 0058 G4ThreeVector EndpointA; 0059 G4ThreeVector VecAtoB; 0060 G4double fABdistanceSq = 0.0; 0061 }; 0062 0063 // Inline methods implementations 0064 0065 inline 0066 G4double G4LineSection::GetABdistanceSq() const 0067 { 0068 return fABdistanceSq; 0069 } 0070 0071 inline 0072 G4double G4LineSection::Distline( const G4ThreeVector& OtherPnt, 0073 const G4ThreeVector& LinePntA, 0074 const G4ThreeVector& LinePntB ) 0075 { 0076 G4LineSection LineAB( LinePntA, LinePntB ); // Line from A to B 0077 return LineAB.Dist( OtherPnt ); 0078 } 0079 0080 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |