#include <G4INCLThreeVector.hh>
Definition at line 54 of file G4INCLThreeVector.hh.
G4INCL::ThreeVector::ThreeVector |
( |
| ) |
|
|
inline |
ThreeVector G4INCL::ThreeVector::anyOrthogonal |
( |
| ) |
const |
|
inline |
Return a vector orthogonal to this.
Simple algorithm from Hughes and Moeller, J. Graphics Tools 4 (1999) 33.
Definition at line 191 of file G4INCLThreeVector.hh.
194 else if(y<=x && y<=z)
std::string G4INCL::ThreeVector::dump |
( |
| ) |
const |
|
inline |
Definition at line 206 of file G4INCLThreeVector.hh.
207 std::stringstream ss;
208 ss <<
"(vector3 " << x <<
" " << y <<
" " << z <<
")";
G4double G4INCL::ThreeVector::getX |
( |
| ) |
const |
|
inline |
G4double G4INCL::ThreeVector::getY |
( |
| ) |
const |
|
inline |
G4double G4INCL::ThreeVector::getZ |
( |
| ) |
const |
|
inline |
G4double G4INCL::ThreeVector::mag |
( |
| ) |
const |
|
inline |
Get the length of the vector.
Definition at line 73 of file G4INCLThreeVector.hh.
73 {
return std::sqrt(x*x + y*y + z*z); }
G4double G4INCL::ThreeVector::mag2 |
( |
| ) |
const |
|
inline |
Get the square of the length.
Definition at line 78 of file G4INCLThreeVector.hh.
78 {
return (x*x + y*y + z*z); }
template<typename T >
void G4INCL::ThreeVector::operator*= |
( |
const T & |
c | ) |
|
|
inline |
Divides all components of the vector with a constant number.
Definition at line 165 of file G4INCLThreeVector.hh.
167 return ThreeVector(x*oneOverC, y*oneOverC, z*oneOverC);
template<typename T >
void G4INCL::ThreeVector::operator/= |
( |
const T & |
c | ) |
|
|
inline |
G4double G4INCL::ThreeVector::perp |
( |
| ) |
const |
|
inline |
G4double G4INCL::ThreeVector::perp2 |
( |
| ) |
const |
|
inline |
G4double G4INCL::ThreeVector::phi |
( |
| ) |
const |
|
inline |
Phi angle
Definition at line 90 of file G4INCLThreeVector.hh.
91 return x == 0.0 && y == 0.0 ? 0.0 : std::atan2(y,x);
std::string G4INCL::ThreeVector::print |
( |
| ) |
const |
|
inline |
Definition at line 200 of file G4INCLThreeVector.hh.
201 std::stringstream ss;
202 ss <<
"(x = " << x <<
" y = " << y <<
" z = " << z <<
")";
Rotate the vector by a given angle around a given axis.
- Parameters
-
angle | the rotation angle |
axis | the rotation axis, which must be a unit vector |
Definition at line 179 of file G4INCLThreeVector.hh.
183 (*this) = (*this) * cos + axis.vector(*
this) * sin + axis * (axis.dot(*
this)*(1.-cos));
static G4double angle[DIM]
G4double G4INCL::ThreeVector::theta |
( |
| ) |
const |
|
inline |
Theta angle
Definition at line 83 of file G4INCLThreeVector.hh.
84 return x == 0.0 && y == 0.0 && z == 0.0 ? 0.0 : std::atan2(
perp(),z);
The documentation for this class was generated from the following file: